钩子文档

customize_render_panel_{$this->id}

💡 云策文档标注

概述

customize_render_panel_{$this->id} 是一个 WordPress 动作钩子,在渲染特定 Customizer 面板之前触发。钩子名称的动态部分 $this->id 对应要渲染面板的 ID。

关键要点

  • 这是一个动态钩子,钩子名称包含面板 ID 变量 $this->id,用于针对特定 Customizer 面板执行操作。
  • 钩子在 WP_Customize_Panel::maybe_render() 方法中调用,用于检查权限并渲染面板。
  • 从 WordPress 4.0.0 版本开始引入。

代码示例

do_action( "customize_render_panel_{$this->id}" );

📄 原文内容

Fires before rendering a specific Customizer panel.

Description

The dynamic portion of the hook name, $this->id, refers to the ID of the specific Customizer panel to be rendered.

Source

do_action( "customize_render_panel_{$this->id}" );

Changelog

Version Description
4.0.0 Introduced.