manage_pages_custom_column WordPress Action Hook

The manage_pages_custom_column hook allows you to add custom columns to the "Pages" admin screen. This can be useful for displaying page-specific data that you want to be able to quickly see and manage. To use this hook, you first need to register a custom column by specifying the column header and callback function. The callback function will be responsible for outputting the data for each page. Once you have registered a custom column, it will appear on the "Pages" admin screen.

do_action( 'manage_pages_custom_column', string $column_name, int $post_id ) #

Fires in each custom column on the Posts list table.


Description

This hook only fires if the current post type is hierarchical, such as pages.


Top ↑

Parameters

$column_name

(string)The name of the column to display.

$post_id

(int)The current post ID.


Top ↑

More Information

Combined with the manage_pages_columns filter, this allows you to add or remove (unset) custom columns to the list page pages. Note that if you are using custom post types and it has ‘hierarchical‘ => true, then you will need to use this action hook and not manage_$post_type_posts_custom_column.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

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