admin管理员组文章数量:1415664
My goal: A custom post type with a complete custom editor page and post list table.
I have set show_ui
to false. It removed the UI section. But if some admin puts direct link (wp-admin/edit.php?post_type=custom_post) in the browser, it takes them to the post table page, and clicking from there takes to editor page. How can I stop this? I don't want anyone to get access to this two pages. I have made two custom pages for them.
Or is there any other better way?
My goal: A custom post type with a complete custom editor page and post list table.
I have set show_ui
to false. It removed the UI section. But if some admin puts direct link (wp-admin/edit.php?post_type=custom_post) in the browser, it takes them to the post table page, and clicking from there takes to editor page. How can I stop this? I don't want anyone to get access to this two pages. I have made two custom pages for them.
Or is there any other better way?
Share Improve this question edited Oct 6, 2015 at 12:41 тнє Sufi asked Oct 4, 2015 at 20:14 тнє Sufiтнє Sufi 1,7104 gold badges19 silver badges28 bronze badges1 Answer
Reset to default 0Yes. Use capabilities! When registering a post type, take a look at the capability_type
and capabilities
.
You can define a custom capability map for the standard edit_post
, delete_post
, etc. for your post type.
The thing you remember is, if you customize the capabilities, YOU DON'T HAVE THESE CAPABILITIES EITHER! This means you'll have to get those capabilities on your user role. (probably Administrator?)
You need to then either create a new user role and assign capabilities to it, or just use a plugin like Members which gives you a good interface to create these and assign capabilities to existing roles, as well as creating new roles altogether.
本文标签: How to remove UI access to Custom Post Type using direct links
版权声明:本文标题:How to remove UI access to Custom Post Type using direct links? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745199523a2647303.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论