mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
use get_users() in get_editable_user_ids() and cache result. See #14572
git-svn-id: https://develop.svn.wordpress.org/trunk@15539 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -149,10 +149,11 @@ if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object-
|
||||
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', $post_type, 'normal', 'core');
|
||||
|
||||
if ( post_type_supports($post_type, 'author') ) {
|
||||
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
if ( ( $authors && count( $authors ) > 1 ) || is_super_admin() )
|
||||
$_editable_user_ids = get_editable_user_ids( $current_user->id, true, $post_type ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $_editable_user_ids) )
|
||||
$_editable_user_ids[] = $post->post_author;
|
||||
|
||||
if ( !empty($_editable_user_ids) || is_super_admin() )
|
||||
add_meta_box('authordiv', __('Author'), 'post_author_meta_box', $post_type, 'normal', 'core');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user