Make WordPress Core

Changeset 47364


Ignore:
Timestamp:
02/25/2020 04:39:36 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-includes
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r47198 r47364  
    185185         *     @type string               $setting         The primary setting for the control (if there is one).
    186186         *                                                 Default 'default'.
     187         *     @type string               $capability      Capability required to use this control. Normally this is empty
     188         *                                                 and the capability is derived from `$settings`.
    187189         *     @type int                  $priority        Order priority to load the control. Default 10.
    188190         *     @type string               $section         Section the control belongs to. Default empty.
    … …  
    196198         *                                                 used for 'checkbox', 'radio', 'select', 'textarea', or
    197199         *                                                 'dropdown-pages' control types. Default empty array.
     200         *     @type bool                 $allow_addition  Show UI for adding new content, currently only used for the
     201         *                                                 dropdown-pages control. Default false.
    198202         *     @type array                $json            Deprecated. Use WP_Customize_Control::json() instead.
    199203         *     @type string               $type            Control type. Core controls include 'text', 'checkbox',
    … …  
    201205         *                                                 input types such as 'email', 'url', 'number', 'hidden', and
    202206         *                                                 'date' are supported implicitly. Default 'text'.
     207         *     @type callback             $active_callback Active callback.
    203208         * }
    204209         */
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r47233 r47364  
    39943994         *
    39953995         * @param WP_Customize_Control|string $id   Customize Control object, or ID.
    3996          * @param array                       $args {
    3997          *  Optional. Array of properties for the new Control object. Default empty array.
    3998          *
    3999          *  @type array        $settings              All settings tied to the control. If undefined, defaults to `$setting`.
    4000          *                                            IDs in the array correspond to the ID of a registered `WP_Customize_Setting`.
    4001          *  @type string       $setting               The primary setting for the control (if there is one). Default is 'default'.
    4002          *  @type string       $capability            Capability required to use this control. Normally derived from `$settings`.
    4003          *  @type int          $priority              Order priority to load the control. Default 10.
    4004          *  @type string       $section               The section this control belongs to. Default empty.
    4005          *  @type string       $label                 Label for the control. Default empty.
    4006          *  @type string       $description           Description for the control. Default empty.
    4007          *  @type array        $choices               List of choices for 'radio' or 'select' type controls, where values
    4008          *                                            are the keys, and labels are the values. Default empty array.
    4009          *  @type array        $input_attrs           List of custom input attributes for control output, where attribute
    4010          *                                            names are the keys and values are the values. Default empty array.
    4011          *  @type bool         $allow_addition        Show UI for adding new content, currently only used for the
    4012          *                                            dropdown-pages control. Default false.
    4013          *  @type string       $type                  The type of the control. Default 'text'.
    4014          *  @type callback     $active_callback       Active callback.
    4015          * }
     3996         * @param array                       $args Optional. Array of properties for the new Control object.
     3997         *                                          See WP_Customize_Control::__construct() for information
     3998         *                                          on accepted arguments. Default empty array.
    40163999         * @return WP_Customize_Control             The instance of the control that was added.
    40174000         */
  • trunk/src/wp-includes/customize/class-wp-customize-color-control.php

    r47363 r47364  
    4848         * @param array                $args    Optional. Arguments to override class property defaults.
    4949         *                                      See WP_Customize_Control::__construct() for information
    50          *                                      on accepted arguments.
     50         *                                      on accepted arguments. Default empty array.
    5151         */
    5252        public function __construct( $manager, $id, $args = array() ) {
  • trunk/src/wp-includes/customize/class-wp-customize-media-control.php

    r47363 r47364  
    5050         * @param array                $args    Optional. Arguments to override class property defaults.
    5151         *                                      See WP_Customize_Control::__construct() for information
    52          *                                      on accepted arguments.
     52         *                                      on accepted arguments. Default empty array.
    5353         */
    5454        public function __construct( $manager, $id, $args = array() ) {
  • trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-control.php

    r47363 r47364  
    4444         * @param array                $args    Optional. Arguments to override class property defaults.
    4545         *                                      See WP_Customize_Control::__construct() for information
    46          *                                      on accepted arguments.
     46         *                                      on accepted arguments. Default empty array.
    4747         */
    4848        public function __construct( $manager, $id, $args = array() ) {
  • trunk/src/wp-includes/customize/class-wp-customize-new-menu-control.php

    r47363 r47364  
    3939         * @param array                $args    Optional. Arguments to override class property defaults.
    4040         *                                      See WP_Customize_Control::__construct() for information
    41          *                                      on accepted arguments.
     41         *                                      on accepted arguments. Default empty array.
    4242         */
    4343        public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
  • trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php

    r47363 r47364  
    3636         * @param array                $args    Optional. Arguments to override class property defaults.
    3737         *                                      See WP_Customize_Control::__construct() for information
    38          *                                      on accepted arguments.
     38         *                                      on accepted arguments. Default empty array.
    3939         */
    4040        public function __construct( $manager, $id, $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.