Post Formats: Pass post type to the disable_formats_dropdown filter in WP_Posts_List_Table::formats_dropdown().

Props MatheusFD, birgire.
Fixes #47959.
Built from https://develop.svn.wordpress.org/trunk@47472


git-svn-id: http://core.svn.wordpress.org/trunk@47259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-03-18 19:13:10 +00:00
parent e94cd4e1a0
commit c6c8862b87
2 changed files with 6 additions and 4 deletions

View File

@ -469,17 +469,19 @@ class WP_Posts_List_Table extends WP_List_Table {
* @since 5.2.0 * @since 5.2.0
* @access protected * @access protected
* *
* @param string $post_type Post type key. * @param string $post_type Post type slug.
*/ */
protected function formats_dropdown( $post_type ) { protected function formats_dropdown( $post_type ) {
/** /**
* Filters whether to remove the 'Formats' drop-down from the post list table. * Filters whether to remove the 'Formats' drop-down from the post list table.
* *
* @since 5.2.0 * @since 5.2.0
* @since 5.5.0 The `$post_type` parameter was added.
* *
* @param bool $disable Whether to disable the drop-down. Default false. * @param bool $disable Whether to disable the drop-down. Default false.
* @param string $post_type Post type slug.
*/ */
if ( apply_filters( 'disable_formats_dropdown', false ) ) { if ( apply_filters( 'disable_formats_dropdown', false, $post_type ) ) {
return; return;
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-alpha-47471'; $wp_version = '5.5-alpha-47472';
/** /**
* 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.