Use create_posts whenever linking to post-new.php. props johnbillion. fixes #16714.

git-svn-id: http://core.svn.wordpress.org/trunk@22900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-28 18:24:11 +00:00
parent b9b520de18
commit f63e0b1df9
2 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false,
$menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon ); $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon );
$submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype"); $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype");
$submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->edit_posts, "post-new.php?post_type=$ptype" ); $submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, "post-new.php?post_type=$ptype" );
$i = 15; $i = 15;
foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {

View File

@ -486,7 +486,7 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
$cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' ); $cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' );
if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->edit_posts ) ) if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->create_posts ) )
$actions[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' ); $actions[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' );
if ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) ) if ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) )
@ -495,14 +495,14 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
if ( current_user_can( 'manage_links' ) ) if ( current_user_can( 'manage_links' ) )
$actions[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' ); $actions[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' );
if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->edit_posts ) ) if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->create_posts ) )
$actions[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' ); $actions[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' );
unset( $cpts['post'], $cpts['page'], $cpts['attachment'] ); unset( $cpts['post'], $cpts['page'], $cpts['attachment'] );
// Add any additional custom post types. // Add any additional custom post types.
foreach ( $cpts as $cpt ) { foreach ( $cpts as $cpt ) {
if ( ! current_user_can( $cpt->cap->edit_posts ) ) if ( ! current_user_can( $cpt->cap->create_posts ) )
continue; continue;
$key = 'post-new.php?post_type=' . $cpt->name; $key = 'post-new.php?post_type=' . $cpt->name;