Use $ptype_obj->edit_type_cap instead of 'edit_posts' for custom post_type menu's & edit.php access. Allows for a user to have the capability to edit a post_type irrespective of their Posts access. Props rovo89. Fixes #12691

git-svn-id: https://develop.svn.wordpress.org/trunk@13841 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-03-27 06:40:59 +00:00
parent 9b51769311
commit c161ae3d7d
2 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -118,9 +118,9 @@ foreach ( (array) get_post_types( array('show_ui' => true) ) as $ptype ) {
$ptype_obj = get_post_type_object($ptype);
$menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-posts', 'menu-' . sanitize_html_class($ptype), 'div');
$submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), 'edit_posts', "edit.php?post_type=$ptype");
$submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), $ptype_obj->edit_type_cap, "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" );
$submenu["edit.php?post_type=$ptype"][10] = array( _x('Add New', 'post'), $ptype_obj->edit_type_cap, "post-new.php?post_type=$ptype" );
$i = 15;
foreach ( $wp_taxonomies as $tax ) {