manage_{$post->post_type}_posts_custom_column WordPress Action Hook

The manage_{$post->post_type}_posts_custom_column hook allows you to add custom columns to the manage posts screen for a particular post type. This hook is called for each custom column added with the add_filter function.

do_action( "manage_{$post->post_type}_posts_custom_column", string $column_name, int $post_id ) #

Fires for each custom column of a specific post type in the Posts list table.


Description

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

Possible hook names include:

  • manage_post_posts_custom_column
  • manage_page_posts_custom_column

Top ↑

Parameters

$column_name

(string)The name of the column to display.

$post_id

(int)The current post ID.


Top ↑

More Information

This action is called whenever a value for a custom column should be output for a custom post type. Combined with the manage_${post_type}_posts_columns filter, this allows you to add or remove (unset) custom columns to a list of custom post types.

For built-in post types and multiple custom types, use manage_posts_custom_column.

Terms and Taxonomies

When passing this function on terms and taxonomies, a third parameter is added.

$column_name
(string) (required) The name of the column to display.
Default: None

$term_id
(int) (required) The ID of the current term. Can also be taken from the global $current_screen->taxonomy.
Default: None

$null
(null) (required) Unused and won’t pass anything.
Default: None


Top ↑

Source

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

View on Trac



Top ↑

Changelog

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