类文档

WP_Customize_Background_Image_Setting

💡 云策文档标注

概述

WP_Customize_Background_Image_Setting 是 WordPress 自定义器中的一个设置类,用于管理背景图像设置。它继承自 WP_Customize_Setting,提供特定于背景图像的功能。

关键要点

  • WP_Customize_Background_Image_Setting 是 WP_Customize_Setting 的子类,专门处理背景图像设置。
  • 该类具有唯一标识符 $id 设置为 'background_image_thumb',用于在自定义器中识别。
  • 包含一个 update 方法,用于移除主题修改中的背景图像缩略图设置。
  • 自 WordPress 3.4.0 版本引入,是自定义器 API 的一部分。

代码示例

final class WP_Customize_Background_Image_Setting extends WP_Customize_Setting {

	/**
	 * Unique string identifier for the setting.
	 *
	 * @since 3.4.0
	 * @var string
	 */
	public $id = 'background_image_thumb';

	/**
	 * @since 3.4.0
	 *
	 * @param mixed $value The value to update. Not used.
	 */
	public function update( $value ) {
		remove_theme_mod( 'background_image_thumb' );
	}
}

📄 原文内容

Customizer Background Image Setting class.

Description

See also

Methods

Name Description
WP_Customize_Background_Image_Setting::update

Source

final class WP_Customize_Background_Image_Setting extends WP_Customize_Setting {

	/**
	 * Unique string identifier for the setting.
	 *
	 * @since 3.4.0
	 * @var string
	 */
	public $id = 'background_image_thumb';

	/**
	 * @since 3.4.0
	 *
	 * @param mixed $value The value to update. Not used.
	 */
	public function update( $value ) {
		remove_theme_mod( 'background_image_thumb' );
	}
}

Changelog

Version Description
3.4.0 Introduced.