wpseek.com
WordPress开发者和主题制作者的搜索引擎
_add_post_type_submenus is private and should not be used in themes or plugins directly.
_add_post_type_submenus › WordPress Function
Since3.1.0
已弃用n/a
› _add_post_type_submenus ( 没有参数 )
访问: |
|
定义在: |
|
文档: |
Adds submenus for post types.
Related Functions: add_post_type_support, get_post_type_labels, get_all_post_type_supports, post_type_supports, post_type_exists
源码
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" ); } }