Archived

This topic is now archived and is closed to further replies.

  • 0

Remove Pagelines Button From Top Admin Bar

Question

Posted · Report post

how can i remove the PageLines Button from the top admin bar in the backend?

Share this post


Link to post
Share on other sites

23 answers to this question

Posted · Report post

ok - must have confused my own admin modifications... :abe:

Share this post


Link to post
Share on other sites

Posted · Report post

I've just used this in my test site and it's hidden the button, do you have any caching plugins which could be preventing the changes showing instantly? Screenshot - http://screencast.com/t/ZYN4THm1M


#wp-admin-bar-pl_settings {display:none;}

or try

#wp-admin-bar-pl_settings {display:none !important;}

Share this post


Link to post
Share on other sites

Posted · Report post

Excellent, thanks for following up :-)

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

Add this to your functions.php file in either your child theme or PageLines Customisation plugin.


add_action( 'wp_before_admin_bar_render', 'pl_admin_bar' );

function pl_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('pl_settings'); // Removes the PageLines menu
$wp_admin_bar->remove_menu('template_type'); // Removes the Template name menu
}[/CODE]

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

The menus are only visible to users with the edit_theme_options role. Unless all your visiters are Administrators?

Share this post


Link to post
Share on other sites

Posted · Report post

Can you please take a screenshot and point out which one you're referring to?

Share this post


Link to post
Share on other sites

Posted · Report post

Can you please take a screenshot and point out which one you're referring to?

Usually i have a plugin for admin menu but i just can't get rid of that item.

#wp-admin-bar-pl_settings {

display: none;

}

that did not work!

post-9549-0-57605900-1351272430_thumb.pn

Share this post


Link to post
Share on other sites

Posted · Report post

Please try this CSS:

li#wp-admin-bar-pl_settings li.menupop {display: none;}[/CODE]

Share this post


Link to post
Share on other sites

Posted · Report post

thanks catrina, but that changes nothing - strange :(

Share this post


Link to post
Share on other sites

Posted · Report post

What is your reason for wanting to remove that link from the admin bar? (To prevent access?)

Share this post


Link to post
Share on other sites

Posted · Report post

yes, preventing access for people without any knowledge.

i use a plugin user access manager - but this works only on the left side of the wordpress admin, not on the top quicklinks wordpress admin menu.

now access to pagelines via quicklinks is not possible though, but the menu still appears.

once there was a working function for PlatformPro ....

Share this post


Link to post
Share on other sites

Posted · Report post

I would advise continuing working with the CSS (the selector may need to be more specific). For example:

#wpadminbar li#wp-admin-bar-pl_settings li.menupop {display: none;}[/CODE]

Share this post


Link to post
Share on other sites

Posted · Report post

have to finish for today, i'll try that later ... thanks so far!

Share this post


Link to post
Share on other sites

Posted · Report post

No problem

Share this post


Link to post
Share on other sites

Posted · Report post

For various reasons Adminmize did not do what I need in this case. I'm also using the Members plugin and due to some rights I need to give a few users I can't disallow certain things with the plugins.

 

Regardless, here's the code I was looking for:

$wp_admin_bar->remove_menu('special_settings');

Also, viewing the source of the rendered page shows the Admin Bar items and that's how I found 'special_settings'.

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

new idea:

in wp its easy to use a function for the admin bar items:


// since wp33 customize new admin bar	

function customize_admin_bar() {

global $wp_admin_bar;

if ( !is_admin_bar_showing() ) {

return;

}

$wp_admin_bar->remove_menu('wp-logo');

$wp_admin_bar->remove_menu('comments');

$wp_admin_bar->remove_menu('appearance');

$wp_admin_bar->remove_menu('view-site');

$wp_admin_bar->remove_menu('new-content');

$wp_admin_bar->remove_menu('settings');

}

add_action(

'wp_before_admin_bar_render',

'customize_admin_bar'

);

is there a way to remove pagelines item?

Share this post


Link to post
Share on other sites

Posted · Report post

thank you!

thats a big point - concerning wordpress user management - with a lot of work to do in further development.

until that we have to stick to functions and plugins...

Share this post


Link to post
Share on other sites

Posted · Report post

@james b: that was the first thing i tried. but i found no way - the css display none is not working - flushed the cache and everything. display none works in firebug but not within the child theme css.

 

@simon: it's visible for editors - but when they click on it they would have no access to the settings tab and thats confusing for clients.

 

@danny thanks - thats it!

 

solved!

Share this post


Link to post
Share on other sites

Posted · Report post

function remove_admin_bar_links() {
    global $wp_admin_bar;
	$wp_admin_bar->remove_menu('pl_settings');
	$wp_admin_bar->remove_menu('template_type');
}
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );

This works great, but what about the Admin Menu bar > Edit Meta menu item, which leads here:

website/wp-admin/admin.php?page=pagelines_special#blog_page

 

None of the following work:

$wp_admin_bar->remove_menu('edit_meta');

$wp_admin_bar->remove_menu('pl_meta');

$wp_admin_bar->remove_menu('pl_edit_meta');

 

On a side note, how does one go about finding the menu item names (slugs?) to add into code such as this?

I know how to find the slug for a post or page but not Admin menu or Dashboard menu items.

 

Firebug, Chrome Dev nor Safari Dev seems to show them.

Share this post


Link to post
Share on other sites

Posted · Report post

Hello Dario 

 

Please could you create your own topic for this as this topic has been answered 

Share this post


Link to post
Share on other sites

Posted · Report post

No problem Martin.

Would you like to remove my question from this topic?

 

Regardless, I answered both of my questions on my own so I guess there's no need to repost.

Share this post


Link to post
Share on other sites