Title: Customizer Responsive Server-Side Components Device Preview
Author: Weston Ruter
Published: <strong>2016 年 10 月 29 日</strong>
Last modified: 2017 年 11 月 9 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/customizer-responsive-device-preview.
svg)

# Customizer Responsive Server-Side Components Device Preview

 作者：[Weston Ruter](https://profiles.wordpress.org/westonruter/)

[下载](https://downloads.wordpress.org/plugin/customizer-responsive-device-preview.0.1.1.zip)

 * [详情](https://cn.wordpress.org/plugins/customizer-responsive-device-preview/#description)
 * [评价](https://cn.wordpress.org/plugins/customizer-responsive-device-preview/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/customizer-responsive-device-preview/#developers)

 [支持](https://wordpress.org/support/plugin/customizer-responsive-device-preview/)

## 描述

Read full writeup: [Previewing Themes with Adaptive Designs in the Customizer](https://make.xwp.co/2016/10/29/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](https://core.trac.wordpress.org/ticket/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. 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. 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`. 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()`, and `Jetpack_User_Agent_Info::is_tablet()`
will all return the expected values based on the current previewed device.

**Development of this plugin is done [on GitHub](https://github.com/xwp/wp-customizer-responsive-device-preview).
Pull requests welcome. Please see [issues](https://github.com/xwp/wp-customizer-responsive-device-preview/issues)
reported there before going to the [plugin forum](https://wordpress.org/support/plugin/customizer-responsive-device-preview).**

## 评价

此插件暂无评价。

## 贡献者及开发者

「Customizer Responsive Server-Side Components Device Preview」是开源软件。 以下
人员对此插件做出了贡献。

贡献者

 *   [ Weston Ruter ](https://profiles.wordpress.org/westonruter/)
 *   [ XWP ](https://profiles.wordpress.org/xwp/)

[帮助将「Customizer Responsive Server-Side Components Device Preview」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/customizer-responsive-device-preview)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/customizer-responsive-device-preview/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/customizer-responsive-device-preview/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/customizer-responsive-device-preview/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/customizer-responsive-device-preview/)。

## 更新日志

#### 0.1.1 [2017-11-01]

 * Update minimum required version of WordPress to 4.7.
 * Re-use `parseQueryString` from core.
 * Explicitly require PHP 5.3.
 * Clean up JS, upgrade dev-lib.

#### 0.1.0 [2016-10-05]

Initial release.

## 额外信息

 *  版本 **0.1.1**
 *  最后更新：**9 年前**
 *  活跃安装数量 **70+**
 *  WordPress 版本 ** 4.7 或更高版本 **
 *  已测试的最高版本为 **4.9.29**
 *  PHP 版本 ** 5.3 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/customizer-responsive-device-preview/)
 * 标签
 * [adaptive](https://cn.wordpress.org/plugins/tags/adaptive/)[customize](https://cn.wordpress.org/plugins/tags/customize/)
   [customizer](https://cn.wordpress.org/plugins/tags/customizer/)[responsive](https://cn.wordpress.org/plugins/tags/responsive/)
   [rwd](https://cn.wordpress.org/plugins/tags/rwd/)
 *  [高级视图](https://cn.wordpress.org/plugins/customizer-responsive-device-preview/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/customizer-responsive-device-preview/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/customizer-responsive-device-preview/reviews/)

## 贡献者

 *   [ Weston Ruter ](https://profiles.wordpress.org/westonruter/)
 *   [ XWP ](https://profiles.wordpress.org/xwp/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/customizer-responsive-device-preview/)