customize_previewable_devices
云策文档标注
概述
customize_previewable_devices 是一个 WordPress 过滤器,用于修改 Customizer 中可预览的设备列表。它允许开发者自定义设备选项,如添加或移除设备类型。
关键要点
- 这是一个过滤器,用于调整 Customizer 预览时的可用设备列表。
- 参数 $devices 是一个数组,包含设备标签和默认设置。
- 通过 apply_filters 调用,开发者可以修改 $devices 数组以自定义预览设备。
- 相关函数 WP_Customize_Manager::get_previewable_devices() 返回可预览设备列表。
- 该过滤器自 WordPress 4.5.0 版本引入。
原文内容
Filters the available devices to allow previewing in the Customizer.
Description
See also
Parameters
$devicesarray-
List of devices with labels and default setting.
Source
$devices = apply_filters( 'customize_previewable_devices', $devices );
Changelog
| Version | Description |
|---|---|
| 4.5.0 | Introduced. |