diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index ce0f711694..7f14187fc7 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -639,7 +639,6 @@ final class WP_Customize_Background_Image_Setting extends WP_Customize_Setting { * * @since 4.3.0 * - * @see wp_get_nav_menu_items() * @see WP_Customize_Setting */ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { @@ -654,7 +653,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Setting type. * * @since 4.3.0 - * + * @access public * @var string */ public $type = self::TYPE; @@ -663,9 +662,10 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Default setting value. * * @since 4.3.0 + * @access public + * @var array * * @see wp_setup_nav_menu_item() - * @var array */ public $default = array( // The $menu_item_data for wp_update_nav_menu_item(). @@ -691,7 +691,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Default transport. * * @since 4.3.0 - * + * @access public * @var string */ public $transport = 'postMessage'; @@ -704,7 +704,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * @todo Should this be $db_id, and also use this for WP_Customize_Nav_Menu_Setting::$term_id * * @since 4.3.0 - * + * @access public * @var int */ public $post_id; @@ -718,11 +718,11 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * a real post. * * @since 4.3.0 + * @access public + * @var int * * @see WP_Customize_Nav_Menu_Item_Setting::update() * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response() - * - * @var int */ public $previous_post_id; @@ -731,7 +731,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * which ensures that we can apply the proper filters. * * @since 4.3.0 - * + * @access public * @var int */ public $original_nav_menu_term_id; @@ -740,7 +740,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Whether or not preview() was called. * * @since 4.3.0 - * + * @access protected * @var bool */ protected $is_previewed = false; @@ -749,7 +749,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Whether or not update() was called. * * @since 4.3.0 - * + * @access protected * @var bool */ protected $is_updated = false; @@ -761,11 +761,11 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * When status is error, the error is stored in $update_error. * * @since 4.3.0 + * @access public + * @var string updated|inserted|deleted|error * * @see WP_Customize_Nav_Menu_Item_Setting::update() * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response() - * - * @var string updated|inserted|deleted|error */ public $update_status; @@ -773,11 +773,11 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Any error object returned by wp_update_nav_menu_item() when setting is updated. * * @since 4.3.0 + * @access public + * @var WP_Error * * @see WP_Customize_Nav_Menu_Item_Setting::update() * @see WP_Customize_Nav_Menu_Item_Setting::amend_customize_save_response() - * - * @var WP_Error */ public $update_error; @@ -787,11 +787,13 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Any supplied $args override class property defaults. * * @since 4.3.0 + * @access public * - * @param WP_Customize_Manager $manager Manager instance. + * @param WP_Customize_Manager $manager Bootstrap Customizer instance. * @param string $id An specific ID of the setting. Can be a * theme mod or option name. * @param array $args Optional. Setting arguments. + * * @throws Exception If $id is not valid for this setting type. */ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) { @@ -815,10 +817,11 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Get the instance data for a given widget setting. * * @since 4.3.0 + * @access public * * @see wp_setup_nav_menu_item() * - * @return array + * @return array Instance data. */ public function value() { if ( $this->is_previewed && $this->_previewed_blog_id === get_current_blog_id() ) { @@ -889,6 +892,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Handle previewing the setting. * * @since 4.3.0 + * @access public * * @see WP_Customize_Manager::post_value() */ @@ -916,6 +920,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Filter the wp_get_nav_menu_items() result to supply the previewed menu items. * * @since 4.3.0 + * @access public * * @see wp_get_nav_menu_items() * @@ -987,6 +992,8 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Re-apply the tail logic also applied on $items by wp_get_nav_menu_items(). * * @since 4.3.0 + * @access public + * @static * * @see wp_get_nav_menu_items() * @@ -1021,8 +1028,9 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Get the value emulated into a WP_Post and set up as a nav_menu_item. * * @since 4.3.0 + * @access public * - * @return WP_Post With {@see wp_setup_nav_menu_item()} applied. + * @return WP_Post With wp_setup_nav_menu_item() applied. */ public function value_as_wp_post_nav_menu_item() { $item = (object) $this->value(); @@ -1055,9 +1063,11 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * we remove that in this override. * * @since 4.3.0 + * @access public * * @param array $menu_item_value The value to sanitize. - * @return array|false|null Null if an input isn't valid. False if it is marked for deletion. Otherwise the sanitized value. + * @return array|false|null Null if an input isn't valid. False if it is marked for deletion. + * Otherwise the sanitized value. */ public function sanitize( $menu_item_value ) { // Menu is marked for deletion. @@ -1132,13 +1142,14 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * To delete a menu, the client can send false as the value. * * @since 4.3.0 + * @access protected * * @see wp_update_nav_menu_item() * - * @param array|false $value The menu item array to update. If false, then the menu item will be deleted entirely. - * See {@see WP_Customize_Nav_Menu_Item_Setting::$default} for what the value should - * consist of. - * @return void + * @param array|false $value The menu item array to update. If false, then the menu item will be deleted + * entirely. See WP_Customize_Nav_Menu_Item_Setting::$default for what the value + * should consist of. + * @return null|void */ protected function update( $value ) { if ( $this->is_updated ) { @@ -1263,11 +1274,12 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { * Export data for the JS client. * * @since 4.3.0 + * @access public * * @see WP_Customize_Nav_Menu_Item_Setting::update() * * @param array $data Additional information passed back to the 'saved' event on `wp.customize`. - * @return array + * @return array Save response data. */ public function amend_customize_save_response( $data ) { if ( ! isset( $data['nav_menu_item_updates'] ) ) { @@ -1280,7 +1292,6 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { 'error' => $this->update_error ? $this->update_error->get_error_code() : null, 'status' => $this->update_status, ); - return $data; } } @@ -1308,7 +1319,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Setting type. * * @since 4.3.0 - * + * @access public * @var string */ public $type = self::TYPE; @@ -1317,10 +1328,10 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Default setting value. * * @since 4.3.0 + * @access public + * @var array * * @see wp_get_nav_menu_object() - * - * @var array */ public $default = array( 'name' => '', @@ -1333,7 +1344,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Default transport. * * @since 4.3.0 - * + * @access public * @var string */ public $transport = 'postMessage'; @@ -1344,7 +1355,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * A negative value represents a placeholder ID for a new menu not yet saved. * * @since 4.3.0 - * + * @access public * @var int */ public $term_id; @@ -1358,11 +1369,11 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * a real term. * * @since 4.3.0 + * @access public + * @var int * * @see WP_Customize_Nav_Menu_Setting::update() * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response() - * - * @var int */ public $previous_term_id; @@ -1370,7 +1381,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Whether or not preview() was called. * * @since 4.3.0 - * + * @access protected * @var bool */ protected $is_previewed = false; @@ -1379,7 +1390,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Whether or not update() was called. * * @since 4.3.0 - * + * @access protected * @var bool */ protected $is_updated = false; @@ -1391,11 +1402,11 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * When status is error, the error is stored in $update_error. * * @since 4.3.0 + * @access public + * @var string updated|inserted|deleted|error * * @see WP_Customize_Nav_Menu_Setting::update() * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response() - * - * @var string updated|inserted|deleted|error */ public $update_status; @@ -1403,11 +1414,11 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Any error object returned by wp_update_nav_menu_object() when setting is updated. * * @since 4.3.0 + * @access public + * @var WP_Error * * @see WP_Customize_Nav_Menu_Setting::update() * @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response() - * - * @var WP_Error */ public $update_error; @@ -1417,11 +1428,13 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Any supplied $args override class property defaults. * * @since 4.3.0 + * @access public * - * @param WP_Customize_Manager $manager Manager instance. + * @param WP_Customize_Manager $manager Bootstrap Customizer instance. * @param string $id An specific ID of the setting. Can be a * theme mod or option name. * @param array $args Optional. Setting arguments. + * * @throws Exception If $id is not valid for this setting type. */ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) { @@ -1442,10 +1455,11 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Get the instance data for a given widget setting. * * @since 4.3.0 + * @access public * * @see wp_get_nav_menu_object() * - * @return array + * @return array Instance data. */ public function value() { if ( $this->is_previewed && $this->_previewed_blog_id === get_current_blog_id() ) { @@ -1487,6 +1501,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Handle previewing the setting. * * @since 4.3.0 + * @access public * * @see WP_Customize_Manager::post_value() */ @@ -1510,6 +1525,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Requesting a nav_menu object by anything but ID is not supported. * * @since 4.3.0 + * @access public * * @see wp_get_nav_menu_object() * @@ -1558,9 +1574,10 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Filter the nav_menu_options option to include this menu's auto_add preference. * * @since 4.3.0 + * @access public * * @param array $nav_menu_options Nav menu options including auto_add. - * @return array + * @return array (Kaybe) modified nav menu options. */ public function filter_nav_menu_options( $nav_menu_options ) { if ( $this->_previewed_blog_id !== get_current_blog_id() ) { @@ -1584,9 +1601,11 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * we remove that in this override. * * @since 4.3.0 + * @access public * * @param array $value The value to sanitize. - * @return array|false|null Null if an input isn't valid. False if it is marked for deletion. Otherwise the sanitized value. + * @return array|false|null Null if an input isn't valid. False if it is marked for deletion. + * Otherwise the sanitized value. */ public function sanitize( $value ) { // Menu is marked for deletion. @@ -1631,6 +1650,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * To delete a menu, the client can send false as the value. * * @since 4.3.0 + * @access public * * @see wp_update_nav_menu_object() * @@ -1643,7 +1663,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * @type int $parent The id of the parent term. Default 0. * @type bool $auto_add Whether pages will auto_add to this menu. Default false. * } - * @return void + * @return null|void */ protected function update( $value ) { if ( $this->is_updated ) { @@ -1730,9 +1750,10 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { } /** - * Update a nav_menu_options array. + * Updates a nav_menu_options array. * * @since 4.3.0 + * @access public * * @see WP_Customize_Nav_Menu_Setting::filter_nav_menu_options() * @see WP_Customize_Nav_Menu_Setting::update() @@ -1740,7 +1761,7 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * @param array $nav_menu_options Array as returned by get_option( 'nav_menu_options' ). * @param int $menu_id The term ID for the given menu. * @param bool $auto_add Whether to auto-add or not. - * @return array + * @return array (Maybe) modified nav_menu_otions array. */ protected function filter_nav_menu_options_value( $nav_menu_options, $menu_id, $auto_add ) { $nav_menu_options = (array) $nav_menu_options; @@ -1762,11 +1783,12 @@ class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting { * Export data for the JS client. * * @since 4.3.0 + * @access public * * @see WP_Customize_Nav_Menu_Setting::update() * * @param array $data Additional information passed back to the 'saved' event on `wp.customize`. - * @return array + * @return array Export data. */ public function amend_customize_save_response( $data ) { if ( ! isset( $data['nav_menu_updates'] ) ) {