开发者 |
xwp
westonruter |
---|---|
更新时间 | 2017年11月9日 14:47 |
PHP版本: | 5.3 及以上 |
WordPress版本: | 4.9 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
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. Pull requests welcome. Please see issues reported there before going to the plugin forum.
parseQueryString
from core.