在自定义帖子类型列表中显示自定义分类列 [英] Showing custom taxonomy column in custom posts type listings

查看:27
本文介绍了在自定义帖子类型列表中显示自定义分类列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为横幅的自定义帖子类型.因此,我注册了一个名为 location 的新分类法,用于指定要在哪个页面上显示横幅.一切都很好,但是当我在管理窗口中单击自定义帖子类型横幅"时,我看到了所有创建的横幅,但是表格中没有用于分类位置"的列.

I have created a custom post type named banners. Thereby I register a new taxonomy called location that specifies on which page the banner is to be shown. Everything is great however when I click on the custom posts type 'Banner' in the admin window I see all the banners created however the table does not have a column for the taxonomy 'Location'.

换句话说,我希望能够在横幅列表中看到横幅所在的位置.

In other words I want to be able to see what location the banner is in, in the banners listing.

推荐答案

对于那些感兴趣的人,register_taxonomy 函数,如WordPress 3.5 现在为 show_admin_column 提供一个参数(默认为 false).设置为 true,它会自动在管理员中显示分类列.

For those interested, the register_taxonomy function, as of WordPress 3.5, now offers an argument for show_admin_column (false by default). Set to true, it automatically displays the taxonomy column in the admin.

这篇关于在自定义帖子类型列表中显示自定义分类列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆