• I have a plugin (S2Member) that allows different levels of subscribers for a customer’s site.

    I want to edit the Grey admin bar according to the user account type.

    Example:

    Admin account = bar is default
    Subscriber/All other accounts = bar displays ‘Welcome *account name* with the option to log out or view their profile (custom link)

    How would I go about this?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The admin bar uses the WP_Admin_Bar class. It is instantiated as the global object $wp_admin_bar. There are class methods to add and remove nodes or menus. The file wp-includes/admin-bar.php defines several helper functions that may be useful. The default menus are also defined here, so you can see how one might define custom menus.

    I don’t think there is a way to add arbitrary text, but you could probably add a menu item that points to href=”#” who’s title is the arbitrary text.

Viewing 1 replies (of 1 total)
  • The topic ‘Admin Bar’ is closed to new replies.