Docs: Add a reference to `WP_Customize_Setting::__construct()` for information on accepted arguments in `WP_Customize_Manager::add_setting()`.

Synchronize the documentation between two places, use `WP_Customize_Setting::__construct()` as the canonical source.

Props tmanoilov, marekdedic.
Fixes #48347.
Built from https://develop.svn.wordpress.org/trunk@47384


git-svn-id: http://core.svn.wordpress.org/trunk@47171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-02-27 20:09:06 +00:00
parent ac9b6fcef8
commit 8c5a8f1811
4 changed files with 28 additions and 26 deletions

View File

@ -174,7 +174,7 @@ class WP_Customize_Control {
* @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param WP_Customize_Manager $manager Customizer bootstrap instance.
* @param string $id Control ID. * @param string $id Control ID.
* @param array $args { * @param array $args {
* Optional. Arguments to override class property defaults. * Optional. Array of properties for the new Control object. Default empty array.
* *
* @type int $instance_number Order in which this instance was created in relation * @type int $instance_number Order in which this instance was created in relation
* to other instances. * to other instances.

View File

@ -3356,7 +3356,6 @@ final class WP_Customize_Manager {
* @param bool $post_has_changed Whether the post has changed. * @param bool $post_has_changed Whether the post has changed.
* @param WP_Post $last_revision The last revision post object. * @param WP_Post $last_revision The last revision post object.
* @param WP_Post $post The post object. * @param WP_Post $post The post object.
*
* @return bool Whether a revision should be made. * @return bool Whether a revision should be made.
*/ */
public function _filter_revision_post_has_changed( $post_has_changed, $last_revision, $post ) { public function _filter_revision_post_has_changed( $post_has_changed, $last_revision, $post ) {
@ -3680,26 +3679,13 @@ final class WP_Customize_Manager {
* @since 3.4.0 * @since 3.4.0
* @since 4.5.0 Return added WP_Customize_Setting instance. * @since 4.5.0 Return added WP_Customize_Setting instance.
* *
* @see WP_Customize_Setting::__construct()
* @link https://developer.wordpress.org/themes/customize-api * @link https://developer.wordpress.org/themes/customize-api
* *
* @param WP_Customize_Setting|string $id Customize Setting object, or ID. * @param WP_Customize_Setting|string $id Customize Setting object, or ID.
* @param array $args { * @param array $args Optional. Array of properties for the new Setting object.
* Optional. Array of properties for the new WP_Customize_Setting. Default empty array. * See WP_Customize_Setting::__construct() for information
* * on accepted arguments. Default empty array.
* @type string $type Type of the setting. Default 'theme_mod'.
* @type string $capability Capability required for the setting. Default 'edit_theme_options'
* @type string|array $theme_supports Theme features required to support the panel. Default is none.
* @type string $default Default value for the setting. Default is empty string.
* @type string $transport Options for rendering the live preview of changes in Customizer.
* Using 'refresh' makes the change visible by reloading the whole preview.
* Using 'postMessage' allows a custom JavaScript to handle live changes.
* Default is 'refresh'.
* @type callable $validate_callback Server-side validation callback for the setting's value.
* @type callable $sanitize_callback Callback to filter a Customize setting value in un-slashed form.
* @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is
* JSON serializable.
* @type bool $dirty Whether or not the setting is initially dirty when created.
* }
* @return WP_Customize_Setting The instance of the setting that was added. * @return WP_Customize_Setting The instance of the setting that was added.
*/ */
public function add_setting( $id, $args = array() ) { public function add_setting( $id, $args = array() ) {

View File

@ -156,7 +156,23 @@ class WP_Customize_Setting {
* @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param WP_Customize_Manager $manager Customizer bootstrap instance.
* @param string $id A specific ID of the setting. * @param string $id A specific ID of the setting.
* Can be a theme mod or option name. * Can be a theme mod or option name.
* @param array $args Setting arguments. * @param array $args {
* Optional. Array of properties for the new Setting object. Default empty array.
*
* @type string $type Type of the setting. Default 'theme_mod'.
* @type string $capability Capability required for the setting. Default 'edit_theme_options'
* @type string|array $theme_supports Theme features required to support the panel. Default is none.
* @type string $default Default value for the setting. Default is empty string.
* @type string $transport Options for rendering the live preview of changes in Customizer.
* Using 'refresh' makes the change visible by reloading the whole preview.
* Using 'postMessage' allows a custom JavaScript to handle live changes.
* Default is 'refresh'.
* @type callable $validate_callback Server-side validation callback for the setting's value.
* @type callable $sanitize_callback Callback to filter a Customize setting value in un-slashed form.
* @type callable $sanitize_js_callback Callback to convert a Customize PHP setting value to a value that is
* JSON serializable.
* @type bool $dirty Whether or not the setting is initially dirty when created.
* }
*/ */
public function __construct( $manager, $id, $args = array() ) { public function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_object_vars( $this ) ); $keys = array_keys( get_object_vars( $this ) );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.4-beta3-47383'; $wp_version = '5.4-beta3-47384';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.