_add_post_type_submenus() – Add submenus for post types.

You appear to be a bot. Output may be restricted

Description

Add submenus for post types.

Usage

_add_post_type_submenus();

Parameters

Returns

void

Source

File name: wordpress/wp-includes/post.php
Lines:

1 to 10 of 10
function _add_post_type_submenus() {
  foreach ( get_post_types( array( 'show_ui' => true ) ) as $ptype ) {
    $ptype_obj = get_post_type_object( $ptype );
    // Sub-menus only.
    if ( ! $ptype_obj->show_in_menu || true === $ptype_obj->show_in_menu ) {
      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" );
  }
}
 

 View on GitHub View on Trac