Docs: Add a reference to WP_Customize_Control::__construct() for information on accepted arguments in WP_Customize_Manager::add_control().

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

Props hAmpzter, marekdedic, SergeyBiryukov.
Fixes #48343.
Built from https://develop.svn.wordpress.org/trunk@47364


git-svn-id: http://core.svn.wordpress.org/trunk@47151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2020-02-25 16:41:07 +00:00
parent cfc27d08ce
commit d51c720d2f
8 changed files with 14 additions and 26 deletions

View File

@@ -3993,26 +3993,9 @@ final class WP_Customize_Manager {
* @since 4.5.0 Return added WP_Customize_Control instance.
*
* @param WP_Customize_Control|string $id Customize Control object, or ID.
* @param array $args {
* Optional. Array of properties for the new Control object. Default empty array.
*
* @type array $settings All settings tied to the control. If undefined, defaults to `$setting`.
* IDs in the array correspond to the ID of a registered `WP_Customize_Setting`.
* @type string $setting The primary setting for the control (if there is one). Default is 'default'.
* @type string $capability Capability required to use this control. Normally derived from `$settings`.
* @type int $priority Order priority to load the control. Default 10.
* @type string $section The section this control belongs to. Default empty.
* @type string $label Label for the control. Default empty.
* @type string $description Description for the control. Default empty.
* @type array $choices List of choices for 'radio' or 'select' type controls, where values
* are the keys, and labels are the values. Default empty array.
* @type array $input_attrs List of custom input attributes for control output, where attribute
* names are the keys and values are the values. Default empty array.
* @type bool $allow_addition Show UI for adding new content, currently only used for the
* dropdown-pages control. Default false.
* @type string $type The type of the control. Default 'text'.
* @type callback $active_callback Active callback.
* }
* @param array $args Optional. Array of properties for the new Control object.
* See WP_Customize_Control::__construct() for information
* on accepted arguments. Default empty array.
* @return WP_Customize_Control The instance of the control that was added.
*/
public function add_control( $id, $args = array() ) {