wp/wp-includes/customize/class-wp-customize-nav-menu-setting.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   405 	 * Note that parent::sanitize() erroneously does wp_unslash() on $value, but
   405 	 * Note that parent::sanitize() erroneously does wp_unslash() on $value, but
   406 	 * we remove that in this override.
   406 	 * we remove that in this override.
   407 	 *
   407 	 *
   408 	 * @since 4.3.0
   408 	 * @since 4.3.0
   409 	 *
   409 	 *
   410 	 * @param array $value The value to sanitize.
   410 	 * @param array $value The menu value to sanitize.
   411 	 * @return array|false|null Null if an input isn't valid. False if it is marked for deletion.
   411 	 * @return array|false|null Null if an input isn't valid. False if it is marked for deletion.
   412 	 *                          Otherwise the sanitized value.
   412 	 *                          Otherwise the sanitized value.
   413 	 */
   413 	 */
   414 	public function sanitize( $value ) {
   414 	public function sanitize( $value ) {
   415 		// Menu is marked for deletion.
   415 		// Menu is marked for deletion.
   593 	 * @see WP_Customize_Nav_Menu_Setting::update()
   593 	 * @see WP_Customize_Nav_Menu_Setting::update()
   594 	 *
   594 	 *
   595 	 * @param array $nav_menu_options Array as returned by get_option( 'nav_menu_options' ).
   595 	 * @param array $nav_menu_options Array as returned by get_option( 'nav_menu_options' ).
   596 	 * @param int   $menu_id          The term ID for the given menu.
   596 	 * @param int   $menu_id          The term ID for the given menu.
   597 	 * @param bool  $auto_add         Whether to auto-add or not.
   597 	 * @param bool  $auto_add         Whether to auto-add or not.
   598 	 * @return array (Maybe) modified nav_menu_otions array.
   598 	 * @return array (Maybe) modified nav_menu_options array.
   599 	 */
   599 	 */
   600 	protected function filter_nav_menu_options_value( $nav_menu_options, $menu_id, $auto_add ) {
   600 	protected function filter_nav_menu_options_value( $nav_menu_options, $menu_id, $auto_add ) {
   601 		$nav_menu_options = (array) $nav_menu_options;
   601 		$nav_menu_options = (array) $nav_menu_options;
   602 		if ( ! isset( $nav_menu_options['auto_add'] ) ) {
   602 		if ( ! isset( $nav_menu_options['auto_add'] ) ) {
   603 			$nav_menu_options['auto_add'] = array();
   603 			$nav_menu_options['auto_add'] = array();