manage_posts_columns WordPress Filter Hook
The manage_posts_columns hook allows you to add or remove columns from the Posts list table. This can be useful for adding custom columns for your custom post types or removing unused columns from the default post type.
apply_filters( 'manage_posts_columns', string[] $post_columns , string $post_type ) #
Filters the columns displayed in the Posts list table.
Parameters
- $post_columns
(string[])An associative array of column headings.
- $post_type
(string)The post type slug.
More Information
manage_posts_columns
is a filter applied to the columns shown on the manage posts screen. It’s applied to posts of all types except pages. To add a custom column for pages, hook the manage_pages_columns filter. To add a custom column for specific custom post types, hook the manage_{$post_type}_posts_columns filter.- Built-in Column Types
Listed in order of appearance. By default, all columns supported by the post type are shown.- cb Checkbox for bulk actions.
- title Post title. Includes “edit”, “quick edit”, “trash” and “view” links. If $mode (set from $_REQUEST[‘mode’]) is ‘excerpt’, a post excerpt is included between the title and links.
- author Post author.
- categories Categories the post belongs to.
- tags Tags for the post.
- comments Number of pending comments.
- date The date and publish status of the post.
Source
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |