Show the author dropdown in quick edit even when there is only one contributor-or-higher user and the post belongs to someone who no longer has contributor-or-higher access. fixes #14420

git-svn-id: http://svn.automattic.com/wordpress/trunk@17284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2011-01-13 07:14:12 +00:00
parent 903abc97fb
commit bf473f3545
2 changed files with 5 additions and 2 deletions

View File

@ -764,7 +764,7 @@ 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,
'hide_if_only_one_author' => false,
'who' => 'authors',
'name' => 'post_author',
'class'=> 'authors',
@ -775,7 +775,7 @@ class WP_Posts_List_Table extends WP_List_Table {
$users_opt['show_option_none'] = __( '— No Change —' );
if ( $authors = wp_dropdown_users( $users_opt ) ) :
$authors_dropdown = '<label>';
$authors_dropdown = '<label class="inline-edit-author">';
$authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
$authors_dropdown .= $authors;
$authors_dropdown .= '</label>';

View File

@ -146,6 +146,9 @@ inlineEditPost = {
// author no longer has edit caps, so we need to add them to the list of authors
$(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
}
if ( $(':input[name="post_author"] option', editRow).length == 1 ) {
$('label.inline-edit-author', editRow).hide();
}
for ( var f = 0; f < fields.length; f++ ) {
$(':input[name="'+fields[f]+'"]', editRow).val( $('.'+fields[f], rowData).text() );