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. git-svn-id: https://develop.svn.wordpress.org/trunk@47364 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5178d29f4a
commit
3bd4e3a075
@ -184,6 +184,8 @@ class WP_Customize_Control {
|
|||||||
* be used.
|
* be used.
|
||||||
* @type string $setting The primary setting for the control (if there is one).
|
* @type string $setting The primary setting for the control (if there is one).
|
||||||
* Default 'default'.
|
* Default 'default'.
|
||||||
|
* @type string $capability Capability required to use this control. Normally this is empty
|
||||||
|
* and the capability is derived from `$settings`.
|
||||||
* @type int $priority Order priority to load the control. Default 10.
|
* @type int $priority Order priority to load the control. Default 10.
|
||||||
* @type string $section Section the control belongs to. Default empty.
|
* @type string $section Section the control belongs to. Default empty.
|
||||||
* @type string $label Label for the control. Default empty.
|
* @type string $label Label for the control. Default empty.
|
||||||
@ -195,11 +197,14 @@ class WP_Customize_Control {
|
|||||||
* attribute names are the keys and values are the values. Not
|
* attribute names are the keys and values are the values. Not
|
||||||
* used for 'checkbox', 'radio', 'select', 'textarea', or
|
* used for 'checkbox', 'radio', 'select', 'textarea', or
|
||||||
* 'dropdown-pages' control types. Default empty array.
|
* 'dropdown-pages' control types. Default empty array.
|
||||||
|
* @type bool $allow_addition Show UI for adding new content, currently only used for the
|
||||||
|
* dropdown-pages control. Default false.
|
||||||
* @type array $json Deprecated. Use WP_Customize_Control::json() instead.
|
* @type array $json Deprecated. Use WP_Customize_Control::json() instead.
|
||||||
* @type string $type Control type. Core controls include 'text', 'checkbox',
|
* @type string $type Control type. Core controls include 'text', 'checkbox',
|
||||||
* 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional
|
* 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional
|
||||||
* input types such as 'email', 'url', 'number', 'hidden', and
|
* input types such as 'email', 'url', 'number', 'hidden', and
|
||||||
* 'date' are supported implicitly. Default 'text'.
|
* 'date' are supported implicitly. Default 'text'.
|
||||||
|
* @type callback $active_callback Active callback.
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
public function __construct( $manager, $id, $args = array() ) {
|
public function __construct( $manager, $id, $args = array() ) {
|
||||||
|
@ -3993,26 +3993,9 @@ final class WP_Customize_Manager {
|
|||||||
* @since 4.5.0 Return added WP_Customize_Control instance.
|
* @since 4.5.0 Return added WP_Customize_Control instance.
|
||||||
*
|
*
|
||||||
* @param WP_Customize_Control|string $id Customize Control object, or ID.
|
* @param WP_Customize_Control|string $id Customize Control object, or ID.
|
||||||
* @param array $args {
|
* @param array $args Optional. Array of properties for the new Control object.
|
||||||
* Optional. Array of properties for the new Control object. Default empty array.
|
* See WP_Customize_Control::__construct() for information
|
||||||
*
|
* on accepted arguments. 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.
|
|
||||||
* }
|
|
||||||
* @return WP_Customize_Control The instance of the control that was added.
|
* @return WP_Customize_Control The instance of the control that was added.
|
||||||
*/
|
*/
|
||||||
public function add_control( $id, $args = array() ) {
|
public function add_control( $id, $args = array() ) {
|
||||||
|
@ -47,7 +47,7 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
|
|||||||
* @param string $id Control ID.
|
* @param string $id Control ID.
|
||||||
* @param array $args Optional. Arguments to override class property defaults.
|
* @param array $args Optional. Arguments to override class property defaults.
|
||||||
* See WP_Customize_Control::__construct() for information
|
* See WP_Customize_Control::__construct() for information
|
||||||
* on accepted arguments.
|
* on accepted arguments. Default empty array.
|
||||||
*/
|
*/
|
||||||
public function __construct( $manager, $id, $args = array() ) {
|
public function __construct( $manager, $id, $args = array() ) {
|
||||||
$this->statuses = array( '' => __( 'Default' ) );
|
$this->statuses = array( '' => __( 'Default' ) );
|
||||||
|
@ -49,7 +49,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
|
|||||||
* @param string $id Control ID.
|
* @param string $id Control ID.
|
||||||
* @param array $args Optional. Arguments to override class property defaults.
|
* @param array $args Optional. Arguments to override class property defaults.
|
||||||
* See WP_Customize_Control::__construct() for information
|
* See WP_Customize_Control::__construct() for information
|
||||||
* on accepted arguments.
|
* on accepted arguments. Default empty array.
|
||||||
*/
|
*/
|
||||||
public function __construct( $manager, $id, $args = array() ) {
|
public function __construct( $manager, $id, $args = array() ) {
|
||||||
parent::__construct( $manager, $id, $args );
|
parent::__construct( $manager, $id, $args );
|
||||||
|
@ -43,7 +43,7 @@ class WP_Customize_Nav_Menu_Item_Control extends WP_Customize_Control {
|
|||||||
* @param string $id The control ID.
|
* @param string $id The control ID.
|
||||||
* @param array $args Optional. Arguments to override class property defaults.
|
* @param array $args Optional. Arguments to override class property defaults.
|
||||||
* See WP_Customize_Control::__construct() for information
|
* See WP_Customize_Control::__construct() for information
|
||||||
* on accepted arguments.
|
* on accepted arguments. Default empty array.
|
||||||
*/
|
*/
|
||||||
public function __construct( $manager, $id, $args = array() ) {
|
public function __construct( $manager, $id, $args = array() ) {
|
||||||
parent::__construct( $manager, $id, $args );
|
parent::__construct( $manager, $id, $args );
|
||||||
|
@ -38,7 +38,7 @@ class WP_Customize_New_Menu_Control extends WP_Customize_Control {
|
|||||||
* @param string $id The control ID.
|
* @param string $id The control ID.
|
||||||
* @param array $args Optional. Arguments to override class property defaults.
|
* @param array $args Optional. Arguments to override class property defaults.
|
||||||
* See WP_Customize_Control::__construct() for information
|
* See WP_Customize_Control::__construct() for information
|
||||||
* on accepted arguments.
|
* on accepted arguments. Default empty array.
|
||||||
*/
|
*/
|
||||||
public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
|
public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
|
||||||
_deprecated_function( __METHOD__, '4.9.0' );
|
_deprecated_function( __METHOD__, '4.9.0' );
|
||||||
|
@ -35,7 +35,7 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control
|
|||||||
* @param string $id Control ID.
|
* @param string $id Control ID.
|
||||||
* @param array $args Optional. Arguments to override class property defaults.
|
* @param array $args Optional. Arguments to override class property defaults.
|
||||||
* See WP_Customize_Control::__construct() for information
|
* See WP_Customize_Control::__construct() for information
|
||||||
* on accepted arguments.
|
* on accepted arguments. Default empty array.
|
||||||
*/
|
*/
|
||||||
public function __construct( $manager, $id, $args = array() ) {
|
public function __construct( $manager, $id, $args = array() ) {
|
||||||
parent::__construct( $manager, $id, $args );
|
parent::__construct( $manager, $id, $args );
|
||||||
|
Loading…
Reference in New Issue
Block a user