From 5cbc7a706de39c7c7724944c349a590f23f4bf2d Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 19 Aug 2015 06:22:40 +0000 Subject: [PATCH] The `'restrict_manage_posts'` hook currently fires on the Post and Media list tables, but is passed zero arguments. Pass `$post_type`. Props sunnyratilal, scribu. Fixes #17891. git-svn-id: https://develop.svn.wordpress.org/trunk@33644 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-media-list-table.php | 3 ++- src/wp-admin/includes/class-wp-posts-list-table.php | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php index 9c61fc28ef..41a9887c88 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -148,7 +148,8 @@ class WP_Media_List_Table extends WP_List_Table { } /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */ - do_action( 'restrict_manage_posts' ); + do_action( 'restrict_manage_posts', $this->screen->post_type ); + submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); } 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 04639347d2..9a5ad92205 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -333,8 +333,10 @@ class WP_Posts_List_Table extends WP_List_Table { * Posts list table, and sorting by date on the Pages list table. * * @since 2.1.0 + * + * @param string $post_type The post type slug. */ - do_action( 'restrict_manage_posts' ); + do_action( 'restrict_manage_posts', $this->screen->post_type ); submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); } @@ -1513,8 +1515,8 @@ class WP_Posts_List_Table extends WP_List_Table { * * @since 2.7.0 * - * @param string $column_name Name of the column to edit. - * @param WP_Post $post_type The post type slug. + * @param string $column_name Name of the column to edit. + * @param string $post_type The post type slug. */ do_action( 'quick_edit_custom_box', $column_name, $screen->post_type ); }