WordPress.org

Make WordPress Core

Ticket #35203: 35203.diff

File 35203.diff, 786 bytes (added by celloexpressions, 4 years ago)

Introduce customize_setup_nav_menu_item filter to allow modifications to nav-menu-item as wp_post objects in the Customizer.

  • src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php

     
    570570                /** This filter is documented in wp-includes/nav-menu.php */
    571571                $post->description = apply_filters( 'nav_menu_description', wp_trim_words( $post->description, 200 ) );
    572572
    573                 return $post;
     573                /**
     574                 * Filter a navigation menu item object in the customizer.
     575                 *
     576                 * @since 4.6.0
     577                 *
     578                 * @param object $post The menu item WP_Post object.
     579                 */
     580                return apply_filters( 'customize_setup_nav_menu_item', $post );
    574581        }
    575582
    576583        /**