Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4954
    kayamurer
    Participant

    Hi there

    I like to remove the Wp Bakery Page Builder menu item from the menu for e specific user role.
    If i check the checkbox to hide the menu item it disappears, but there is still a different entry that has the following name: Wp bakery Page Builder – Grid Builder.
    How can i remove that? Or is it possible to remove specific classes or something?

    #4956
    Vladimir
    Keymaster

    Hi,

    I will need access to the latest version of “WP Bakery Page Builder” plugin for the testing purpose.
    “Visual Composer->Grid Builder” from the older version is hidden as expected at my test site.

    I will be out of office the next 2 days and can be able to proceed with this issue from June, 21st only.

    #4959
    Vladimir
    Keymaster

    Thanks for the provided ability to test “WP Bakery Page Builder”.
    This plugin uses own action to add submenu items and execute code for some menu items later than URE Pro checks admin menu using WordPress default ‘admin_menu’ action.

    Workaround for “Grid Builder”: go to “WP Bakery Page Builder->Role Editor” menu item, scroll to your role and disable “Grid Builder” for that role.
    As a result the single “WP Bakery Page Builder” menu item will be left visible. This plugin forces any user to see its “welcome” page – some kind of advertisement.

    #4963
    Vladimir
    Keymaster

    This code snippet will exclude “WP Bakery Page Builder” welcome page menu item from the left side admin menu for the current user with ‘author’ role:

    
    add_action('admin_menu', 'hide_vc_welcome', 100);
    
    function hide_vc_welcome() {
    
        global $menu;
        
        $user = wp_get_current_user();
        if (empty($user)) {
            return;
        }
        if (!is_array($user->roles) || !in_array('author', $user->roles)) {
            return;
        }
    
        foreach($menu as $key=>$item) {   
            if ($item[2]=='vc-welcome') {
                unset($menu[$key]);
                break;            
            }
        }
    
    }
    
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.