PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Custom Post Type Restriction - Admin Panel?

s2Member Plugin. A Membership plugin for WordPress®.

Custom Post Type Restriction - Admin Panel?

Postby satdaya » January 24th, 2012, 1:52 pm

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
User avatar
satdaya
Registered User
Registered User
 
Posts: 5
Joined: November 28, 2011

Re: Custom Post Type Restriction - Admin Panel?

Postby Bruce C » January 24th, 2012, 3:42 pm

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!
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: Custom Post Type Restriction - Admin Panel?

Postby Cristián Lávaque » January 27th, 2012, 4:53 am

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 1 guest

cron