Hiding admin section messages

What is the easiest way to hide the extra stuff membership adds to the admin area.

I don't want it to display the message saying "You are logged in as a Membership Admin user, you will therefore see all protected content on this site". I also want to disable the box that says to enable membership (since I'm using it only to maintain memberships and all content restriction will be handled by the theme).

I originally thought I would just add some admin CSS but the plugin is using default WordPress content sections (like update nag and error fade). It doesn't seem to add any additional classes to the containers it's using so I can't specifically target them.

  • ThePath

    Yeh you wont be able to do it the CSS way without hiding every WP nag as its a WP API that devs link into.

    I had a quick look and to get rid of the nag you will have to delete a few bits in this file:

    membership/membershipincludes/classes/membershipadmin.php

    remove this section starting on line 244:

    if($user->has_cap('membershipadmin')) {
    				// Show a notice to say that they are logged in as the membership admin user and protection isn't enabled on the front end
    				echo '<div class="update-nag">' . __("You are logged in as a <strong>Membership Admin</strong> user, you will therefore see all protected content on this site.", 'membership') . '</div>';
    			}

    Im unsure as to what you mean by the enable membership thing...screenshot might be helpful.

    Hope that helps

  • george_k

    I know the messages are only available to admins, but you have to remember that many plugins are all trying to fill the admin screen with various messages. If I let every plugin displayed every message and prompt it wanted 50% of the screen would be filled with such warnings.

    i think it's especially confusing for admins (remember, these are clients which may not be that technically savvy) when an area that is supposed to be used for important notifications (update nag) is used for a persistent message.

    I removed it by commenting out the lines mentioned above.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.