[wordpress插件] Customizer Responsive Server-Side Components Device PreviewCustomizer响应式服务器端组件设备预览

wordpress 插件 文章 2020-04-10 22:11 507 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

Read full writeup:

阅读全文:

>Previewing Themes with Adaptive Designs in the Customizer.

>在定制器中预览具有自适应设计的主题。

This plugin extends the responsive device preview functionality in the customizer which was added in 4.5 (see #31195

此插件扩展了4.5中添加的定制程序中的响应设备预览功能(请参阅#31195

).

)。

In core when you change the previewed device it merely changes the dimensions of the preview, allowing you to simulate how the theme will appear on tablet or mobile screens.

核心是,当您更改预览设备时,它仅更改预览的尺寸,从而使您可以模拟主题在平板电脑或移动屏幕上的显示方式。

What it does not do, however, is cause the preview to reload with the User-Agent overridden for the current device being previewed.

但是,它没有执行的操作是使预览重新加载,而 User-Agent 覆盖了当前正在预览的当前设备。

For themes that implement a responsive design this core behavior is just fine since changing the dimensions of the iframe will cause the appropriate media queries to apply.

对于实现响应式设计的主题,此核心行为很好,因为更改iframe的尺寸将导致应用适当的媒体查询。

However, if you have an adaptive design for your theme you won’t be able to see any server-side components that it may display when viewing a different device.

但是,如果您针对主题进行了自适应设计,则在查看其他设备时将看不到它可能显示的任何服务器端组件。

For example, on mobile devices a theme may want to skip outputting the sidebar altogether to save on bandwidth.

例如,在移动设备上,主题可能希望完全跳过输出边栏以节省带宽。

This plugin will ensure that the preview is refreshed when the previewed device is changed in addition to changing the preview window size.

此插件除了更改预览窗口大小外,还可以确保在更改预览设备时刷新预览。

It will pass a customize_previewed_device query parameter on the URL being previewed, and this parameter will be either desktop, tablet, or mobile<

它将在要预览的URL上传递 customize_previewed_device 查询参数,并且该参数将是 desktop tablet mobile <

/code>.

/ code>。

The plugin will override the $_SERVER['HTTP_USER_AGENT'] to be a user agent representative of the supplied device type so that calls to wp_is_mobile(), jetpack_is_mobile(

插件将覆盖 $ _ SERVER ['HTTP_USER_AGENT'] 作为代表所提供设备类型的用户代理,以便调用 wp_is_mobile() jetpack_is_mobile(

), and Jetpack_User_Agent_Info::is_tablet() will all return the expected values based on the current previewed device.

Jetpack_User_Agent_Info :: is_tablet()都将基于当前预览的设备返回期望值。

Development of this plugin is done on GitHub.

此插件的开发在GitHub上 完成。

Pull requests welcome.

拉请求欢迎。

Please see issues reported there before going to the

请先查看其中报告的问题,然后再转到

"https://wordpress.org/support/plugin/customizer-responsive-device-preview">plugin forum.

“ https://wordpress.org/support/plugin/customizer-sensitive-device-preview“>插件论坛。

下载地址
https://downloads.wordpress.org/plugin/customizer-responsive-device-preview.0.1.1.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Age Gate时代之门
[wordpress插件] Advanced Product Fields (Product Options) for WooCommerceWooCommerce的高级产品字段(产品选项)
[wordpress插件] Advanced Custom Fields Migration Cleanup高级自定义字段迁移清除
[wordpress插件] Post Views Count (Support caching plugins!)发布观看次数(支持缓存插件!)
[wordpress插件] AWStats Xtended InfoAWStats扩展信息
随便看看
企业微信通讯录账号被管理员误/恶意删除,怎么办? 7992
问题? 7224
如何快速搭建抽奖助手小程序(无需代码知识) 5016
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 5968
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5492
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5189
如何解决渲染层网络错误Failed to load media? 16544
小程序找号找回 释放昵称? 2412
我的小程序广告主收入5301,实际进账4406,是怎么回事呀? 2491
删除部分微信用户个人数据的通知,怎么删除? 5530