如何让简单的用户喜欢作者在wp添加自定义的帖子类型在wp-admin


how to allow simple user like author in wp to add custom post type in wp-admin?

有人能帮帮我吗这是我的问题如何让简单的用户喜欢作者在wp添加自定义的帖子类型在wp-admin?由于

基本上你可以在注册你的自定义帖子类型时传递这个"capabilities"参数:

...,
'capabilities' => array(
        'publish_posts' => 'read',
        'edit_posts' => 'read',
        'edit_others_posts' => 'edit_others_posts',
        'delete_posts' => 'delete_posts',
        'delete_others_posts' => 'delete_others_posts',
        'read_private_posts' => 'read',
        'edit_post' => 'read',
        'delete_post' => 'read',
        'read_post' => 'read',
        ),
...

假设"订阅者"只有read能力,那么他将能够访问管理中的CPT菜单,列出所有CPT,…

但是这可能不是很安全,因为read功能与订阅者实际要做的事情无关。

最好像WordPress文档(http://codex.wordpress.org/Function_Reference/register_post_type)中描述的那样创建一个新的功能群。

如果你想在每个帖子的基础上创建更准确的能力,你可以找到一个非常有用的帖子。