Add 'who' arg to wp_dropdown_users() and get_users(). Add' hide_if_only_one_author' argument to get_users(). Query only authors (user level greater than 0) when who => author is passed. Query only authors for author meta box and quick edit dropdowns. Props scribu. fixes #15871
git-svn-id: http://svn.automattic.com/wordpress/trunk@17088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -757,7 +757,6 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
<?php touch_time( 1, 1, 4, 1 ); ?>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
|
||||
<?php endif; // $bulk
|
||||
|
||||
if ( post_type_supports( $screen->post_type, 'author' ) ) :
|
||||
@@ -765,6 +764,8 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
|
||||
if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
|
||||
$users_opt = array(
|
||||
'hide_if_only_one_author' => true,
|
||||
'who' => 'authors',
|
||||
'name' => 'post_author',
|
||||
'class'=> 'authors',
|
||||
'multi' => 1,
|
||||
@@ -772,10 +773,13 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
);
|
||||
if ( $bulk )
|
||||
$users_opt['show_option_none'] = __( '— No Change —' );
|
||||
$authors_dropdown = '<label>';
|
||||
$authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
|
||||
$authors_dropdown .= wp_dropdown_users( $users_opt );
|
||||
$authors_dropdown .= '</label>';
|
||||
|
||||
if ( $authors = wp_dropdown_users( $users_opt ) ) :
|
||||
$authors_dropdown = '<label>';
|
||||
$authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
|
||||
$authors_dropdown .= $authors;
|
||||
$authors_dropdown .= '</label>';
|
||||
endif;
|
||||
endif; // authors
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user