do_action( 'restrict_manage_posts', string $post_type, string $which )
- Since
- 2.1.0, 4.4.0, 4.6.0
Fires before the Filter button on the Posts and Pages list tables.
Description
The Filter button allows sorting by date and/or category on the Posts list table, and sorting by date on the Pages list table.
Compatibility
- WordPress
- since 4.6.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$post_typestring- The post type slug.
$whichstring- The location of the extra table nav markup: 'top' or 'bottom' for WP_Posts_List_Table, 'bar' for WP_Media_List_Table.
Where this hook fires · 2
wp-admin/includes/class-wp-media-list-table.php:215WP_Media_List_Table::extra_tablenav()wp-admin/includes/class-wp-posts-list-table.php:593WP_Posts_List_Table::extra_tablenav()
Source code
* * @param string $post_type The post type slug. * @param string $which The location of the extra table nav markup: * 'top' or 'bottom' for WP_Posts_List_Table, * 'bar' for WP_Media_List_Table. */ do_action( 'restrict_manage_posts', $this->screen->post_type, $which ); $output = ob_get_clean(); if ( ! empty( $output ) ) { echo $output; submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );Changelog
Introduced in 2.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.6.0
The
$which parameter was added.from the docblock4.4.0
The
$post_type parameter was added.from the docblock2.1.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.