最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - Issue removing columns from admin table

programmeradmin1浏览0评论

I'm trying to remove the columns thumbnail and featured from an admin table. At the same time I'm adding one additional column. The post type is property. I would like to do it via code instead of using plugin as I would need to do some additional customisations.

None of the hooks I tried seem to work.

  • manage_property_posts_columns
  • manage_posts_columns
  • manage_property_posts_custom_column

Interesting thing is that the same code works on different post types.

What could be the issue?

add_filter( 'manage_property_posts_columns', 'remove_property_columns' );

function remove_property_columns( $columns ) {
    unset($columns['thumbnail']);
    unset($columns['featured']);
    $columns['test'] =  'Test' ;
    return $columns;
}
发布评论

评论列表(0)

  1. 暂无评论