Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_add_post_type_submenus [ WordPress Function ]

_add_post_type_submenus ( No parameters )
Access:
  • private
Defined at:



Adds submenus for post types.

Source


<?php
function _add_post_type_submenus() {
    foreach ( 
get_post_types( array( 'show_ui' => true ) ) as $ptype ) {
        
$ptype_obj get_post_type_object$ptype );
        
// Submenus only.
        
if ( ! $ptype_obj->show_in_menu || $ptype_obj->show_in_menu === true )
            continue;
        
add_submenu_page$ptype_obj->show_in_menu$ptype_obj->labels->name$ptype_obj->labels->all_items$ptype_obj->cap->edit_posts"edit.php?post_type=$ptype);
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics