manage_posts_columns
Filters the columns displayed in the Posts list table.
Usage
add_filter( 'manage_posts_columns', 'wp_kama_manage_posts_columns_filter', 10, 2 ); /** * Function for `manage_posts_columns` filter-hook. * * @param string[] $post_columns An associative array of column headings. * @param string $post_type The post type slug. * * @return string[] */ function wp_kama_manage_posts_columns_filter( $post_columns, $post_type ){ // filter... return $post_columns; }
- $post_columns(string[])
- An associative array of column headings.
- $post_type(string)
- The post type slug.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
manage_posts_columns
wp-admin/includes/class-wp-posts-list-table.php 739
$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );