mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Use meta caps edit_post, read_post, and delete_post directly, rather than consulting the post type object. map_meta_cap() handles that for us. props markjaquith, kovshenin. fixes #23226.
git-svn-id: https://develop.svn.wordpress.org/trunk@24593 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -429,7 +429,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
||||
if ( 'post' == $current_screen->base
|
||||
&& 'add' != $current_screen->action
|
||||
&& ( $post_type_object = get_post_type_object( $post->post_type ) )
|
||||
&& current_user_can( $post_type_object->cap->read_post, $post->ID )
|
||||
&& current_user_can( 'read_post', $post->ID )
|
||||
&& ( $post_type_object->public )
|
||||
&& ( $post_type_object->show_in_admin_bar ) )
|
||||
{
|
||||
@@ -457,7 +457,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
||||
|
||||
if ( ! empty( $current_object->post_type )
|
||||
&& ( $post_type_object = get_post_type_object( $current_object->post_type ) )
|
||||
&& current_user_can( $post_type_object->cap->edit_post, $current_object->ID )
|
||||
&& current_user_can( 'edit_post', $current_object->ID )
|
||||
&& $post_type_object->show_ui && $post_type_object->show_in_admin_bar )
|
||||
{
|
||||
$wp_admin_bar->add_menu( array(
|
||||
|
||||
Reference in New Issue
Block a user