Jump to content
Sign in to follow this  
bloom1creative

Menu Admin Customise for Pagelines

Recommended Posts

bloom1creative+    3
bloom1creative

Hey chaps!

 

Im using the following with no issues at all to block these items from 'Username' admin, but allowing my admin to still remain the same.

function remove_menus()
{
    global $menu;
    global $current_user;
    get_currentuserinfo();
    if($current_user->user_login == 'Username')
    {
    
        $restricted = array(__('Links'),
                            __('Pages'),
                            __('Comments'),
                            __('Appearance'),
                            __('Plugins'),
                            __('Users'),
                            __('Tools'),
                            __('Settings')
        );


        end ($menu);
        while (prev($menu)){
            $value = explode(' ',$menu[key($menu)][0]);
            if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
        }// end while
    }// end if
}
add_action('admin_menu', 'remove_menus');

 

My question to you guys, is how can I target the pagelines menu items this way, as it doesnt seem to work using __('PageLines') which is what I assumed.  I also need to remove the top nav from 'Username' as well, so that user can see nothing to do with Pagelines.

 

I know there is an option in the front end, but I dont want to limit the other menu items from Admin > Editor, as 'Username" requires some Admin menu items.

 

Thank you muchly guys!


Many thanks

 

Rob1n

Share this post


Link to post
Share on other sites
Rob    547
Rob

Hi,

 

I'm unsure what you're trying to accomplish using code, but to hide PageLines from the Admin Dashboard, we have a setting in Dashboard > PageLines > Site Options > Advanced which determines the level at which some PL options are visible to your authorized users.

 

Additionally, plugins are available to manage the rest of your dashboard and keep prying eyes (and frisky fingers) from doing unacceptable things to your site.  While many developers dislike plugins, it's important to keep in mind, sometimes customizations can be overwritten by updates.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
bloom1creative+    3
bloom1creative

I am trying to remove the Pagelines menu item in the same fashion I removed the others, I simply dont know how to target it - I suppose the name or .php file would do the trick :)

 

As I mentioned I am aware the ability to restrict that Pagelines menu from other privileges, but really I want to restrict one of the two Admins, and am yet to find a plugin with this functionality :)


Many thanks

 

Rob1n

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there,

 

You mean hide the pagelines tab from the wp admin area?

 

If you set the user to anything below admin it will automatically hide the pagelines tab from them. There's additional options inside Pagelines>site options>advanced to hide more options from the user depending on their user role.

 

Leave yourself as an admin and give the client the next role down.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
bloom1creative+    3
bloom1creative

Thanks for your help James, but I have found that some clients require the use of the Widgets section or other sections only available to Admins, which causes issues for me with this method.


Many thanks

 

Rob1n

Share this post


Link to post
Share on other sites
Rob    547
Rob

In that case, since Widgets are outside the control of PageLines and part of WordPress, then you'll need a third party plugin to manage the Dashboard.  There are several excellent ones in Wordpress.org.  Try this one: wordpress.org/plugins/dashboard-commander/

 

Customizing code unnecessarily is a sure way of breaking your site, and causing more problems down the road.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×