wppaste
WordPress

_add_post_type_submenus()

Since
3.1.0
Source
wp-includes/post.php:2278
Adds submenus for post types.

Uses · 3

Source

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" );	}}

History

Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/post.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.