manage_{$post_type}_posts_columns WordPress Filter Hook

The manage_{$post_type}_posts_columns hook is called when the list of posts for a particular post type is being displayed in the admin interface. This hook allows you to add or remove columns from the list of posts, as well as modify the contents of the columns.

apply_filters( "manage_{$post_type}_posts_columns", string[] $post_columns ) #

Filters the columns displayed in the Posts list table for a specific post type.


Description

The dynamic portion of the hook name, $post_type, refers to the post type slug.

Possible hook names include:

  • manage_post_posts_columns
  • manage_page_posts_columns

Top ↑

Parameters

$post_columns

(string[])An associative array of column headings.


Top ↑

More Information

$post_columns is an associative array of “column name” ⇒ “label”. The “column name” is passed to callback functions to identify the column. The “label” is shown as the column header.

Built-in Column Types:

Note: 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.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.0.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.