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.


Top ↑

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.

Top ↑

Source

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

View on Trac



Top ↑

Changelog

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