restrict_manage_posts
Fires before the Filter button on the Posts and Pages list tables.
The Filter button allows sorting by date and/or category on the Posts list table, and sorting by date on the Pages list table.
Использование
add_action( 'restrict_manage_posts', 'wp_kama_restrict_manage_posts_action', 10, 2 ); /** * Function for `restrict_manage_posts` action-hook. * * @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. * * @return void */ function wp_kama_restrict_manage_posts_action( $post_type, $which ){ // action... }
- $post_type(строка)
- The post type slug.
- $which(строка)
- The location of the extra table nav markup: 'top' or 'bottom' for WP_Posts_List_Table, 'bar' for WP_Media_List_Table.
Список изменений
С версии 2.1.0 | Введена. |
С версии 4.4.0 | The $post_type parameter was added. |
С версии 4.6.0 | The $which parameter was added. |
Где вызывается хук
restrict_manage_posts
restrict_manage_posts
wp-admin/includes/class-wp-posts-list-table.php 594
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
wp-admin/includes/class-wp-media-list-table.php 215
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );