From b0889a7639501641b63923881023c5f6cc627671 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Mar 2020 19:11:33 +0000 Subject: [PATCH] Post Formats: Pass post type to the `disable_formats_dropdown` filter in `WP_Posts_List_Table::formats_dropdown()`. Props MatheusFD, birgire. Fixes #47959. git-svn-id: https://develop.svn.wordpress.org/trunk@47472 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-posts-list-table.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 3a8dd65936..b1aec0f793 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -469,17 +469,19 @@ class WP_Posts_List_Table extends WP_List_Table { * @since 5.2.0 * @access protected * - * @param string $post_type Post type key. + * @param string $post_type Post type slug. */ protected function formats_dropdown( $post_type ) { /** * Filters whether to remove the 'Formats' drop-down from the post list table. * * @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; }