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™

Code To Remove For Post Restriction Box

s2Member Plugin. A Membership plugin for WordPress®.

Code To Remove For Post Restriction Box

Postby Vinnyo » July 4th, 2011, 8:48 pm

Hey Guys,

Looking for the code I need to remove to get rid of the post restriction box that is located in the ADD NEW post area. The box is located on the right side at the top of the column

Post Level Restriction?
Add Level Restriction?
* see: General Options -> Post Level Access

Require Custom Capabilities?
Custom Capabilities?
* see: API Scripting -> Custom Capabilities

Sorry I am too lazy to take a picture of it but the above info is in the box with the fields left empty of adjusting.

Hope that makes sense. I just want to remove this box so my users don't see it.

All the best
Vince
User avatar
Vinnyo
Registered User
Registered User
 
Posts: 28
Joined: October 1, 2010

Re: Code To Remove For Post Restriction Box

Postby Vinnyo » July 4th, 2011, 9:23 pm

OK I found this topic

viewtopic.php?f=4&t=2313&p=6855&hilit=remove+meta+box#p6855

its exactly what I am trying to do. I created and mu-plugins folder, created a s2-hacks.php file, and inserted the code


Code: Select all
    <?php
    add_action ("plugins_loaded", "my_function");
    function my_function ()
        {
            if (current_user_can ("access_s2member_level2"))
                {
                    remove_action ("add_meta_boxes", "c_ws_plugin__s2member_meta_boxes::add_meta_boxes");
                }
        }
    ?>



hit update and the meta box is still there. Any ideas of what I might be doing wrong?
User avatar
Vinnyo
Registered User
Registered User
 
Posts: 28
Joined: October 1, 2010

Re: Code To Remove For Post Restriction Box

Postby Cristián Lávaque » July 5th, 2011, 12:33 am

The condition there checks for Level 2 users only. If you no one but you to see it, try this

Code: Select all
<?php

add_action 
("plugins_loaded", "my_function");
function my_function ()
{
    if (!is_admin())
        remove_action ("add_meta_boxes", "c_ws_plugin__s2member_meta_boxes::add_meta_boxes");
}

?>
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: No registered users and 3 guests

cron