restrict_manage_posts WordPress Action Hook

The restrict_manage_posts hook is an action hook that is called in the admin panel for each post type. It allows you to add custom filters to the posts list table.

do_action( 'restrict_manage_posts', string $post_type, string $which ) #

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.


Top ↑

Parameters

$post_type

(string)The post type slug.

$which

(string)The location of the extra table nav markup: 'top' or 'bottom' for WP_Posts_List_Table, 'bar' for WP_Media_List_Table.


Top ↑

Source

File: wp-admin/includes/class-wp-posts-list-table.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.6.0The $which parameter was added.
4.4.0The $post_type parameter was added.
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.