类文档

WP_Sidebar_Block_Editor_Control

💡 云策文档标注

概述

WP_Sidebar_Block_Editor_Control 是 WordPress 核心类,用于在自定义器中实现小部件块编辑器控件。它继承自 WP_Customize_Control,提供特定于块编辑器的功能。

关键要点

  • 核心类:用于自定义器中的小部件块编辑器控件实现。
  • 继承关系:扩展自 WP_Customize_Control,类型设置为 'sidebar_block_editor'。
  • 主要方法:render_content() 方法渲染小部件块编辑器容器,依赖 JavaScript 处理具体内容。
  • 引入版本:自 WordPress 5.8.0 起可用。

代码示例

class WP_Sidebar_Block_Editor_Control extends WP_Customize_Control {
    public $type = 'sidebar_block_editor';
    public function render_content() {
        // 渲染空控件,具体由 @wordpress/customize-widgets 中的 JavaScript 处理
    }
}

📄 原文内容

Core class used to implement the widgets block editor control in the customizer.

Description

See also

Methods

Name Description
WP_Sidebar_Block_Editor_Control::render_content Render the widgets block editor container.

Source

class WP_Sidebar_Block_Editor_Control extends WP_Customize_Control {
	/**
	 * The control type.
	 *
	 * @since 5.8.0
	 *
	 * @var string
	 */
	public $type = 'sidebar_block_editor';

	/**
	 * Render the widgets block editor container.
	 *
	 * @since 5.8.0
	 */
	public function render_content() {
		// Render an empty control. The JavaScript in
		// @wordpress/customize-widgets will do the rest.
	}
}

Changelog

Version Description
5.8.0 Introduced.