customize_control_active
云策文档标注
概述
customize_control_active 是一个 WordPress 过滤器,用于修改 WP_Customize_Control::active() 方法的响应,控制 Customizer 控件是否在当前预览中激活。
关键要点
- 过滤器名称:customize_control_active
- 参数:$active(布尔值,表示控件是否激活)和 $control(WP_Customize_Control 实例)
- 用途:允许开发者动态调整 Customizer 控件的激活状态
- 相关函数:WP_Customize_Control::active(),位于 wp-includes/class-wp-customize-control.php
- 引入版本:WordPress 4.0.0
原文内容
Filters response of WP_Customize_Control::active().
Parameters
$activebool-
Whether the Customizer control is active.
$controlWP_Customize_Control-
WP_Customize_Control instance.
Source
$active = apply_filters( 'customize_control_active', $active, $control );
Changelog
| Version | Description |
|---|---|
| 4.0.0 | Introduced. |