mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Add a separate show_ui flag for post types. see #9674
git-svn-id: https://develop.svn.wordpress.org/trunk@12993 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag
|
||||
unset( $_redirect );
|
||||
}
|
||||
|
||||
if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('_show' => true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' => true ) ) ) ) )
|
||||
if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) )
|
||||
$post_type = $_GET['post_type'];
|
||||
else
|
||||
$post_type = 'post';
|
||||
|
||||
+2
-2
@@ -81,10 +81,10 @@ $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='c
|
||||
|
||||
$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
|
||||
|
||||
foreach ( (array) get_post_types( array('_show' => true) ) as $ptype ) {
|
||||
foreach ( (array) get_post_types( array('show_ui' => true) ) as $ptype ) {
|
||||
$_wp_last_object_menu++;
|
||||
$ptype_obj = get_post_type_object($ptype);
|
||||
$menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), 'edit_' . $ptype_obj->capability_type . 's', "edit.php?post_type=$ptype", '', 'menu-top', 'menu-posts', 'div');
|
||||
$menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top', 'menu-posts', 'div');
|
||||
$submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), 'edit_posts', "edit.php?post_type=$ptype");
|
||||
/* translators: add new custom post type */
|
||||
$submenu["edit.php?post_type=$ptype"][10] = array( _x('Add New', 'post'), 'edit_posts', "post-new.php?post_type=$ptype" );
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/** Load WordPress Administration Bootstrap */
|
||||
require_once('admin.php');
|
||||
|
||||
if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('_show' => true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' => true ) ) ) ) )
|
||||
if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) )
|
||||
$post_type = $_GET['post_type'];
|
||||
else
|
||||
$post_type = 'post';
|
||||
|
||||
Reference in New Issue
Block a user