Home > AI > Backend > Wordpress >

wp_filter_object_list

Example :

function st_get_post_type_menu_name() {

    $menu_items = wp_get_nav_menu_items( 'top' );
    $this_item = current(wp_filter_object_list( $menu_items, array( 'object' => get_post_type() ) ) );
    echo $this_item->title;
}

Leave a Reply