Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Restrict post type and child pages
Tagged: custom post types, pages, posts
- This topic has 9 replies, 3 voices, and was last updated 8 years, 6 months ago by Vladimir.
-
AuthorPosts
-
02/06/2015 at 20:32 #1518eshannon3Participant
In the Pro version – I would like some of my users to be able to create and edit only one custom taxonomy. I see the “Posts/Pages Editor Restrictions” section has a setting for “edit posts/pages/custom post types with ID (comma separated)” – how do I get an ID for the custom post type I am working with? And how do I allow users to also be able to create posts of only that custom post type?
Second question – other users need to edit certain pages and all of those pages’ children. Do I have to manually put in a list of each and every page that they can edit, or is there a way to say “this user can edit Page A and all of its children”?
05/06/2015 at 14:09 #1524VladimirKeymaster1) There is now way to manage this by custom post type ID. You should input the ID of the posts of those types which you wish to restrict access to. You may see the post ID at the browser address line when you open that post for the editing.
To restrict access to other post types use:
a) is post type uses its own capabilities set like ‘edit_events’, exclude ‘create_events’ capability from a user role;
b) if post type uses the same ‘edit_posts’ capability use ‘admin access blocking’ add-on: https://www.role-editor.com/block-admin-menu-items2) Currently only the list of posts, pages ID is supported. I think about to add automatic support for the child pages as it is not the 1st feature request. But it is not realized yet.
20/04/2016 at 10:53 #2264ariskatParticipantVladmir… to point number 1 above…
Perhaps I’m asking the same question by asking… is there a way to check if a user has already created a custom post type and then removing his ability to create another. The example is…
A Standard Free User can create one profile portfolio whereas a Premier User must be allowed to create more than profile portfolio.
If not through your plugin which I love… any bit of code that would accomplish what seems like a common goal for any developer. Thanks in advance.20/04/2016 at 10:55 #2265ariskatParticipantAlso, I’m a pro licensed user of your widget… how do I get to start a forum thread here? Am I just missing it? I can reply to post on the forum but don’t see the ability to start a thread topic. New to your site. Thanks.
20/04/2016 at 14:35 #2267VladimirKeymasterTo start a new thread click on the selected forum, scroll to the bottom of the page, use the form you will find there.
20/04/2016 at 14:46 #2268VladimirKeymasterManage a quant of custom post types created by user. It’s not trivial task.
All available to the user post types (built-in and custom) are created on the fly by call of theregister_post_type()
function. WordPress made it itself A lot of plugins may register own custom post types. Active theme may do the same. All of them do this without accent what user does that. So you can not manage this process externally.If some plugin allows is in use for CPT creation I think the only possibility to achieve your goal is to add such restrictions to that plugin. So it adds user ID to any created CPT and count what quant of CPTs is allowed for what user.
20/04/2016 at 23:02 #2269ariskatParticipantFirstly thanks for your reply. I am using your plugin to fullest. I LOVE IT. Secondly, I found this plugin helpful when trying to accomplish what I am describing above…
https://wordpress.org/plugins/bainternet-posts-creation-limits/
It’s all pretty straightforward but the redirect (or error message that appears) when reaching limit is rather ugly and doesn’t look like it’s coming from the same site due to the lack of css and/or wrappers. Thought it might be helpful for the rest of your users…
21/04/2016 at 10:39 #2273VladimirKeymasterI understood now. That’s about posts (not post types) quant limit. It’s a fully different story. Thanks for the idea. May be I will add such module to URE Pro with time.
05/05/2016 at 10:41 #2310ariskatParticipantJust as a quick clarification… to me the ability to limit number of posts (even if it’s a special post type) goes hand in hand with user-role definitions. I would do it two ways… 1. Allow for a limit as to how many posts a user can create. 2. Allow for a limit as to how many posts a user can see. Let me know if you understand what I mean. That would really change the game. Still loving the plug-in using the Pro Version. Worth Every Penny!
06/05/2016 at 13:21 #2311VladimirKeymasterThanks for the feedback.
Let me know more details about option 2. ‘User can see’ what is about? Quant of recent posts available for view at front-end? Or something else?
-
AuthorPosts
- You must be logged in to reply to this topic.