This topic is: not resolved

This topic contains 10 replies, has 3 voices, and was last updated by  ManaKio 3 years, 7 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #73523

    yoann bournazaud
    Member
    Post count: 25

    Hi,

    In the option:
    Admin area access = “admin only”

    I want to keep the admin bar active for everyone even for non connected

    Is it possible?

    Thank you

    #73540

    Nayem
    Moderator
    Post count: 6480

    You can use this code snippets-

    function add_admin_caps() {
        $role = get_role( '###');
        $role->add_cap('delete_artists');
        $role->add_cap('delete_published_artists');
        $role->add_cap('delete_others_artists');
        $role->add_cap('edit_artists');
        $role->add_cap('edit_published_artists');
        $role->add_cap('edit_others_artists');
        $role->add_cap('publish_artists');
        $role->add_cap('read');
        $role->add_cap('upload_files');
        $role->add_cap('manage_artist_categories');
    }
    add_action( 'admin_init', 'add_admin_caps');

    You have to insert those codes in your theme function.php file.

    *** Please replace ### with the role you want to add access of administrator. ๐Ÿ™‚

    #73575

    yoann bournazaud
    Member
    Post count: 25

    Thank you for your answer but I expressed myself badly

    I use a plugin “WP Symposium Toolbar” that can activate the admin bar all the time but your plugin prevents the bar from appearing for not connected user.

    I would like always show the admin bar even for not connected

    Thank you

    #73600

    yoann bournazaud
    Member
    Post count: 25

    Sorry but the plugin doesn't work

    the problem is coming from your plugin: the bar disappears when I activated it and appears when i deactivated your plugin

    Thank you

    #73601

    Nayem
    Moderator
    Post count: 6480

    Hello,

    You can disable those filter from wp-content/plugins/Wp user frontend pro/wpuf.php file. In this file you will get these filter-

    add_action( 'show_admin_bar', array($this, 'show_admin_bar') ); – Comment out this filter then check.

    #73604

    yoann bournazaud
    Member
    Post count: 25

    Perfect his works

    is it possible to desactived this filter directly in the function.php in such a way that I have not to do it again at each update.

    Thank you very much

    #73667

    Nayem
    Moderator
    Post count: 6480

    You can do this by removing the action like – remove_action( 'show_admin_bar', array($this, 'show_admin_bar') );

    #73669

    yoann bournazaud
    Member
    Post count: 25

    Thank you very much

    #73670

    Nayem
    Moderator
    Post count: 6480
    This reply has been marked as private.
    #74134

    ManaKio
    Participant
    Post count: 77

    I have a similar but unrelated issue.

    I do not want the admin bar to show up for anyone from the frontend, logged in or not. Not even myself as the admin etc…

    I have even tried unchecking the box that says “Show Toolbar when viewing site” in the admin edit profile section but the admin bar still shows up on the front end for anyone given the ‘admin' or ‘editor' role.

    I have a plugin installed called “Hide Admin Bar” activated, I have been using it for years and have never had another program override it's settings.

    I also tried a plugin called “Global Hide Admin Toolbar” and it too allows me to hide admin bar on the frontend from all users but WP Users Frontend Pro overrides these plugins and still shows the admin bar.

    What can I do if I don't want “Anyone” not even “Myself” to be bothered with or shown the admin bar in the frontend??

    Thanks!

    #74136

    ManaKio
    Participant
    Post count: 77

    OK, commenting out line 73 add_action( 'show_admin_bar', array($this, 'show_admin_bar') );

    Worked with Global Hide Admin plugin but not with ‘Hide Admin Toolbar'

    So issue is closed for me, thanks…

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Admin bar’ is closed to new replies.