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

functions - Allow Users Access to Custom Post Type Only

programmeradmin0浏览0评论

I am in a similar situation to this person, only I need a bit more hand-holding. I don't have a good understanding of php but can cut and paste code with the best of them.

I have Justin Tadlock's Members plugin, and have set up a custom post type and associated custom taxonomies in my functions.php file.

Here's what I'm trying to accomplish:

  • User registers and is set as Contributor by default.
  • User can now see only this custom post type and can make an entry to this post type, but not publish it.
  • User can only see and edit their own post(s).

If possible, I need specifics on what and where to add to my post type registration function. I understand it involves 'map_meta_cap' and 'capability_type' but I don't know how to write the code or where to put it in the function. Once the capabilities are established I can add them as custom capabilities in the Members plugin.

I am in a similar situation to this person, only I need a bit more hand-holding. I don't have a good understanding of php but can cut and paste code with the best of them.

I have Justin Tadlock's Members plugin, and have set up a custom post type and associated custom taxonomies in my functions.php file.

Here's what I'm trying to accomplish:

  • User registers and is set as Contributor by default.
  • User can now see only this custom post type and can make an entry to this post type, but not publish it.
  • User can only see and edit their own post(s).

If possible, I need specifics on what and where to add to my post type registration function. I understand it involves 'map_meta_cap' and 'capability_type' but I don't know how to write the code or where to put it in the function. Once the capabilities are established I can add them as custom capabilities in the Members plugin.

Share Improve this question edited Apr 13, 2017 at 12:37 CommunityBot 1 asked Apr 24, 2011 at 13:57 kmelkmel 511 gold badge1 silver badge4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

I figured it out on my own -- the code snippet I needed to follow is here. Justin Tadlock is the man.

发布评论

评论列表(0)

  1. 暂无评论