do_action( 'manage_pages_custom_column', string $column_name , int $post_id )
Fires in each custom column on the Posts list table.
Contents
Description
This hook only fires if the current post type is hierarchical, such as pages.
Parameters
-
$column_name
string -
The name of the column to display.
-
$post_id
int -
The current post ID.
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.
Source
File: wp-admin/includes/class-wp-posts-list-table.php
.
View all references
do_action( 'manage_pages_custom_column', $column_name, $post->ID );
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
To add “Template” column into page list:
To add to other post types (not post, page or attachment…):
The hooks to create custom columns and their associated data for a custom post type are
manage_{$post_type}_posts_columns
andmanage_{$post_type}_posts_custom_column
respectively, where{$post_type}
is the name of the custom post type.Example migrated from Codex:
Once you have added your column (for this example, thumbnail), the featured image can be displayed for that page in the new thumbnail column.