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

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

Props amolv, marekdedic.
Fixes #48346.

git-svn-id: https://develop.svn.wordpress.org/trunk@47386 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-02-27 20:27:45 +00:00
parent 33b88a7c7f
commit 19bdff7326
2 changed files with 23 additions and 19 deletions

View File

@ -3899,25 +3899,12 @@ final class WP_Customize_Manager {
* @since 3.4.0
* @since 4.5.0 Return added WP_Customize_Section instance.
*
* @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.
* @see WP_Customize_Section::__construct()
*
* @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.
* }
* @param WP_Customize_Section|string $id Customize Section object, or Section ID.
* @param array $args Optional. Array of properties for the new Section object.
* See WP_Customize_Section::__construct() for information
* on accepted arguments. Default empty array.
* @return WP_Customize_Section The instance of the section that was added.
*/
public function add_section( $id, $args = array() ) {

View File

@ -150,7 +150,24 @@ class WP_Customize_Section {
*
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
* @param string $id A specific ID of the section.
* @param array $args Section arguments.
* @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|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.
* }
*/
public function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_object_vars( $this ) );