manage_{$screen->id}_columns
最后更新于:2021-11-27 06:39:26
apply_filters( “manage_{$screen->id}_columns”, string[] $columns )
Filters the column headers for a list table on a specific screen.
参数
- $columns
-
(string[])
The column header labels keyed by column ID.
源文件
文件: gc-admin/includes/screen.php
add_filter('manage_books_posts_columns' , 'book_cpt_columns'); function book_cpt_columns($columns) { unset( $columns['author'], $columns['comments'] ); $new_columns = array( 'publisher' => __('Publisher', 'ThemeName'), 'book_author' => __('Book Author', 'ThemeName'), ); return array_merge($columns, $new_columns); }
// Filter pages add_filter( 'manage_edit-page_columns', 'my_columns_filter',10, 1 ); // Filter Posts add_filter( 'manage_edit-post_columns', 'my_columns_filter',10, 1 ); // Custom Post Type add_filter( 'manage_edit-CUSTOMPOSTTYPE_columns', 'my_columns_filter',10, 1 ); function my_columns_filter( $columns ) { unset($columns['author']); unset($columns['categories']); unset($columns['tags']); unset($columns['comments']); return $columns; }