From 33b88a7c7ff3e2f2db05d4bbdfe0b10a972b3cab Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 27 Feb 2020 20:21:35 +0000 Subject: [PATCH] Docs: Clarify the type of `theme_supports` argument in various Customizer classes. Props marekdedic. See #48347. git-svn-id: https://develop.svn.wordpress.org/trunk@47385 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-customize-manager.php | 45 +++++++++++-------- src/wp-includes/class-wp-customize-panel.php | 4 +- .../class-wp-customize-section.php | 4 +- .../class-wp-customize-setting.php | 32 ++++++------- 4 files changed, 46 insertions(+), 39 deletions(-) diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 659b1cba9f..b022c1cde8 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -3803,15 +3803,17 @@ final class WP_Customize_Manager { * * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID. * @param array $args { - * Optional. Array of properties for the new Panel object. Default empty array. - * @type int $priority Priority of the panel, defining the display order of panels and sections. - * Default 160. - * @type string $capability Capability required for the panel. Default `edit_theme_options` - * @type string|array $theme_supports Theme features required to support the panel. - * @type string $title Title of the panel to show in UI. - * @type string $description Description to show in the UI. - * @type string $type Type of the panel. - * @type callable $active_callback Active callback. + * Optional. Array of properties for the new Panel object. Default empty array. + * + * @type int $priority Priority of the panel, defining the display order + * of panels and sections. Default 160. + * @type string $capability Capability required for the panel. + * Default `edit_theme_options`. + * @type string|string[] $theme_supports Theme features required to support the panel. + * @type string $title Title of the panel to show in UI. + * @type string $description Description to show in the UI. + * @type string $type Type of the panel. + * @type callable $active_callback Active callback. * } * @return WP_Customize_Panel The instance of the panel that was added. */ @@ -3900,16 +3902,21 @@ final class WP_Customize_Manager { * @param WP_Customize_Section|string $id Customize Section object, or Section ID. * @param array $args { * Optional. Array of properties for the new Section object. Default empty array. - * @type int $priority Priority of the section, defining the display order of panels and sections. - * Default 160. - * @type string $panel The panel this section belongs to (if any). Default empty. - * @type string $capability Capability required for the section. Default 'edit_theme_options' - * @type string|array $theme_supports Theme features required to support the section. - * @type string $title Title of the section to show in UI. - * @type string $description Description to show in the UI. - * @type string $type Type of the section. - * @type callable $active_callback Active callback. - * @type bool $description_hidden Hide the description behind a help icon, instead of inline above the first control. Default false. + * + * @type int $priority Priority of the section, defining the display order + * of panels and sections. Default 160. + * @type string $panel The panel this section belongs to (if any). + * Default empty. + * @type string $capability Capability required for the section. + * Default 'edit_theme_options' + * @type string|string[] $theme_supports Theme features required to support the section. + * @type string $title Title of the section to show in UI. + * @type string $description Description to show in the UI. + * @type string $type Type of the section. + * @type callable $active_callback Active callback. + * @type bool $description_hidden Hide the description behind a help icon, + * instead of inline above the first control. + * Default false. * } * @return WP_Customize_Section The instance of the section that was added. */ diff --git a/src/wp-includes/class-wp-customize-panel.php b/src/wp-includes/class-wp-customize-panel.php index 36092c5f26..858c0885a5 100644 --- a/src/wp-includes/class-wp-customize-panel.php +++ b/src/wp-includes/class-wp-customize-panel.php @@ -69,10 +69,10 @@ class WP_Customize_Panel { public $capability = 'edit_theme_options'; /** - * Theme feature support for the panel. + * Theme features required to support the panel. * * @since 4.0.0 - * @var string|array + * @var string|string[] */ public $theme_supports = ''; diff --git a/src/wp-includes/class-wp-customize-section.php b/src/wp-includes/class-wp-customize-section.php index 4cbc066137..97b1429c61 100644 --- a/src/wp-includes/class-wp-customize-section.php +++ b/src/wp-includes/class-wp-customize-section.php @@ -77,10 +77,10 @@ class WP_Customize_Section { public $capability = 'edit_theme_options'; /** - * Theme feature support for the section. + * Theme features required to support the section. * * @since 3.4.0 - * @var string|array + * @var string|string[] */ public $theme_supports = ''; diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index 10a24afed8..33a7320a08 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -51,10 +51,10 @@ class WP_Customize_Setting { public $capability = 'edit_theme_options'; /** - * Feature a theme is required to support to enable this setting. + * Theme features required to support the setting. * * @since 3.4.0 - * @var string + * @var string|string[] */ public $theme_supports = ''; @@ -157,21 +157,21 @@ class WP_Customize_Setting { * @param string $id A specific ID of the setting. * Can be a theme mod or option name. * @param array $args { - * Optional. Array of properties for the new Setting object. Default empty array. + * 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. + * @type string $type Type of the setting. Default 'theme_mod'. + * @type string $capability Capability required for the setting. Default 'edit_theme_options' + * @type string|string[] $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() ) {