Php 如何将订阅者限制为一种自定义帖子类型,并限制他们编辑其他帖子
嗨,我正在尝试为wordpress网站制作一个自定义部分,我需要给我的订阅者一些访问权限 我创建了一个自定义的帖子类型(boat)。我需要做的是: 1-授予任何订阅我的自定义帖子类型的访问权限 2-向任何订阅者授予仅在其自己的帖子中发布/编辑/删除/上载文件的权限(+将其帖子分配给我创建的一个已创建分类的权限) 3-限制他们查看/编辑其他订阅者的帖子 4-我不希望订阅者看到他们的个人资料和自定义文章类型部分以外的内容 我尝试使用角色范围器、wp成员和Capability Manager,但它们似乎都不是我想要的。如果你知道怎么做我会很感激的Php 如何将订阅者限制为一种自定义帖子类型,并限制他们编辑其他帖子,php,wordpress,permissions,custom-post-type,subscriber,Php,Wordpress,Permissions,Custom Post Type,Subscriber,嗨,我正在尝试为wordpress网站制作一个自定义部分,我需要给我的订阅者一些访问权限 我创建了一个自定义的帖子类型(boat)。我需要做的是: 1-授予任何订阅我的自定义帖子类型的访问权限 2-向任何订阅者授予仅在其自己的帖子中发布/编辑/删除/上载文件的权限(+将其帖子分配给我创建的一个已创建分类的权限) 3-限制他们查看/编辑其他订阅者的帖子 4-我不希望订阅者看到他们的个人资料和自定义文章类型部分以外的内容 我尝试使用角色范围器、wp成员和Capability Manager,但它们似
提前感谢您的帮助。以下是我所做的,我没有授予订阅者所有这些权限,而是将所有订阅者升级为contributor 我将自定义帖子类型的功能更改为:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'boat' ),
'capability_type' => 'post',
'capabilities' => array(
'publish_posts' => 'edit_posts',//contributor can edit
'edit_others_posts' => 'update_core',//administrator can see other
'delete_posts' => 'update_core',//administrator can see other
'delete_others_posts' => 'update_core',//administrator can see other
'read_private_posts' => 'update_core',//administrator can see other
'edit_post' => 'edit_posts',//contributor can edit
'delete_post' => 'update_core',//administrator can see other
'read_post' => 'edit_posts',//contributor can edit
),
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title','revision' )
);
register_post_type("boat", $args);
然后我在不同的网页上添加了一些自定义功能:
这个隐藏了我不想让参与者看到的菜单
资料来源:
以及:
然后,我限制投稿人发表其他文章:
发件人:
最后,我允许贡献者使用以下内容上载文件:
从
由于我的自定义帖子类型中有很多自定义字段,我将媒体上传限制为仅本地帖子,因此我的投稿人不能使用其他人提供的媒体
我希望这会对某人有所帮助!:) 以下是我所做的,我没有授予订阅者所有这些权限,而是将所有订阅者升级为contributor 我将自定义帖子类型的功能更改为:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'boat' ),
'capability_type' => 'post',
'capabilities' => array(
'publish_posts' => 'edit_posts',//contributor can edit
'edit_others_posts' => 'update_core',//administrator can see other
'delete_posts' => 'update_core',//administrator can see other
'delete_others_posts' => 'update_core',//administrator can see other
'read_private_posts' => 'update_core',//administrator can see other
'edit_post' => 'edit_posts',//contributor can edit
'delete_post' => 'update_core',//administrator can see other
'read_post' => 'edit_posts',//contributor can edit
),
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title','revision' )
);
register_post_type("boat", $args);
然后我在不同的网页上添加了一些自定义功能:
这个隐藏了我不想让参与者看到的菜单
资料来源:
以及:
然后,我限制投稿人发表其他文章:
发件人:
最后,我允许贡献者使用以下内容上载文件:
从
由于我的自定义帖子类型中有很多自定义字段,我将媒体上传限制为仅本地帖子,因此我的投稿人不能使用其他人提供的媒体
我希望这会对某人有所帮助!:) 以下是我所做的,我没有授予订阅者所有这些权限,而是将所有订阅者升级为contributor 我将自定义帖子类型的功能更改为:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'boat' ),
'capability_type' => 'post',
'capabilities' => array(
'publish_posts' => 'edit_posts',//contributor can edit
'edit_others_posts' => 'update_core',//administrator can see other
'delete_posts' => 'update_core',//administrator can see other
'delete_others_posts' => 'update_core',//administrator can see other
'read_private_posts' => 'update_core',//administrator can see other
'edit_post' => 'edit_posts',//contributor can edit
'delete_post' => 'update_core',//administrator can see other
'read_post' => 'edit_posts',//contributor can edit
),
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title','revision' )
);
register_post_type("boat", $args);
然后我在不同的网页上添加了一些自定义功能:
这个隐藏了我不想让参与者看到的菜单
资料来源:
以及:
然后,我限制投稿人发表其他文章:
发件人:
最后,我允许贡献者使用以下内容上载文件:
从
由于我的自定义帖子类型中有很多自定义字段,我将媒体上传限制为仅本地帖子,因此我的投稿人不能使用其他人提供的媒体
我希望这会对某人有所帮助!:) 以下是我所做的,我没有授予订阅者所有这些权限,而是将所有订阅者升级为contributor 我将自定义帖子类型的功能更改为:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'boat' ),
'capability_type' => 'post',
'capabilities' => array(
'publish_posts' => 'edit_posts',//contributor can edit
'edit_others_posts' => 'update_core',//administrator can see other
'delete_posts' => 'update_core',//administrator can see other
'delete_others_posts' => 'update_core',//administrator can see other
'read_private_posts' => 'update_core',//administrator can see other
'edit_post' => 'edit_posts',//contributor can edit
'delete_post' => 'update_core',//administrator can see other
'read_post' => 'edit_posts',//contributor can edit
),
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title','revision' )
);
register_post_type("boat", $args);
然后我在不同的网页上添加了一些自定义功能:
这个隐藏了我不想让参与者看到的菜单
资料来源:
以及:
然后,我限制投稿人发表其他文章:
发件人:
最后,我允许贡献者使用以下内容上载文件:
从
由于我的自定义帖子类型中有很多自定义字段,我将媒体上传限制为仅本地帖子,因此我的投稿人不能使用其他人提供的媒体
我希望这会对某人有所帮助!:)