Page 1 of 1

Custom Post Type Restriction - Admin Panel?

PostPosted: January 24th, 2012, 1:52 pm
by satdaya
Hi,

So we have events that came built in on a theme that we don't want to use. We're using Events Manager instead. So now we have two "Events" sections on the navigation in the admin panel, and I need to remove or block the Events that we aren't using for highest user level, because the client is not very web savvy and will probably get confused.

So I tried adding to Post restrictions, all-mw_events (mw_events is the name of the custom post type). Nope, did not do the trick. It seems that the restriction will only apply to front end, not back end (admin panel). Correct?

Or do I need to tweak that setting elsewhere? I'm going ahead and digging around in theme files to find the part that adds the custom post type and remove it. Wish me luck! I'm not much of a programmer.

Elise

Re: Custom Post Type Restriction - Admin Panel?

PostPosted: January 24th, 2012, 3:42 pm
by Bruce C
You're gonna need to create a custom function for this, instead of using a plugin to do it, I actually just created a little tutorial on custom post types, and they are very simple. You could actually just use the current_user_can() hook to check whether or not you should add the post type.

Here's a link to the tutorial:

http://s2installs.com/log-1-custom-post ... wordpress/

simply change the info in the source code that you can download at the bottom of the page, and wrap it in

Code: Select all
if (current_user_can ('administrator')) //change the current_user_can value to what you would like it to be
{
//code for the custom post type
}


You'll also have to change the add_action function to work with the current_user_can function, by using 'wp_head' instead of 'init'.

If you think it's too much work for you, you can send a request in at http://s2installs.com/ and we can do this for $50 in just a couple hours.

Hope that helps!

Re: Custom Post Type Restriction - Admin Panel?

PostPosted: January 27th, 2012, 4:53 am
by Cristián Lávaque
satdaya wrote:It seems that the restriction will only apply to front end, not back end (admin panel). Correct?


That's right. s2Member only manages access to content on the front end of WordPress, not the admin side.