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.
Built from https://develop.svn.wordpress.org/trunk@49238


git-svn-id: http://core.svn.wordpress.org/trunk@49000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-10-20 16:40:05 +00:00
parent 35681b0e9a
commit be5fb561ad
2 changed files with 17 additions and 3 deletions

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 );
?> ?>

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-alpha-49237'; $wp_version = '5.6-alpha-49238';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.