Quick/Bulk Edit: Introduce quick_edit_dropdown_authors_args filter.

This allows for customizing the arguments used to generate the Quick Edit authors drop-down.

Additionally, pass the `$bulk` argument to the `quick_edit_dropdown_pages_args` filter, for consistency.

Props Mista-Flo, garrett-eclipse, hellofromTonya.
Fixes #47685.

git-svn-id: https://develop.svn.wordpress.org/trunk@49238 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-10-20 16:38:32 +00:00
parent 980a387347
commit af6ecf2d16

View File

@ -1587,6 +1587,18 @@ class WP_Posts_List_Table extends WP_List_Table {
$users_opt['show_option_none'] = __( '— No Change —' ); $users_opt['show_option_none'] = __( '— No Change —' );
} }
/**
* Filters the arguments used to generate the Quick Edit authors drop-down.
*
* @since 5.6.0
*
* @see wp_dropdown_users()
*
* @param array $users_opt An array of arguments passed to wp_dropdown_users().
* @param bool $bulk A flag to denote if it's a bulk action.
*/
$users_opt = apply_filters( 'quick_edit_dropdown_authors_args', $users_opt, $bulk );
$authors = wp_dropdown_users( $users_opt ); $authors = wp_dropdown_users( $users_opt );
if ( $authors ) : if ( $authors ) :
$authors_dropdown = '<label class="inline-edit-author">'; $authors_dropdown = '<label class="inline-edit-author">';
@ -1682,12 +1694,14 @@ class WP_Posts_List_Table extends WP_List_Table {
* Filters the arguments used to generate the Quick Edit page-parent drop-down. * Filters the arguments used to generate the Quick Edit page-parent drop-down.
* *
* @since 2.7.0 * @since 2.7.0
* @since 5.6.0 The `$bulk` parameter was added.
* *
* @see wp_dropdown_pages() * @see wp_dropdown_pages()
* *
* @param array $dropdown_args An array of arguments. * @param array $dropdown_args An array of arguments passed to wp_dropdown_pages().
* @param bool $bulk A flag to denote if it's a bulk action.
*/ */
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args ); $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args, $bulk );
wp_dropdown_pages( $dropdown_args ); wp_dropdown_pages( $dropdown_args );
?> ?>