nav_menu_meta_box_object

nav_menu_meta_box_object

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('nav_menu_meta_box_object') is found 3 times:

  • /wp-admin/includes/ajax-actions.php line 1893
    1889
    1890
    1891
    1892
    1893
    1894
    1895
    1896
    1897
    1898
    1899
    if ( ! empty( $_POST['item-object'] ) && isset( $items[ $_POST['item-object'] ] ) ) {
        $menus_meta_box_object = $items[ $_POST['item-object'] ];
     
        /** This filter is documented in wp-admin/includes/nav-menu.php */
        $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
     
        $box_args = array(
            'id'       => 'add-' . $item->name,
            'title'    => $item->labels->name,
            'callback' => $callback,
            'args'     => $item,
  • /wp-admin/includes/nav-menu.php line 260
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    *
     * @param WP_Post_Type|false $post_type The current object to add a menu items
     *                                      meta box for.
     */
    $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
     
    if ( $post_type ) {
        $id = $post_type->name;
        // Give pages a higher priority.
        $priority = ( 'page' === $post_type->name ? 'core' : 'default' );
        add_meta_box(
  • /wp-admin/includes/nav-menu.php line 293
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    }
     
    foreach ( $taxonomies as $tax ) {
        /** This filter is documented in wp-admin/includes/nav-menu.php */
        $tax = apply_filters( 'nav_menu_meta_box_object', $tax );
     
        if ( $tax ) {
            $id = $tax->name;
            add_meta_box(
                "add-{$id}",
                $tax->labels->name,

See this hook used in plugins: