• Resolved halloy

    (@halloy)


    Hello, is it possible to display/hide the plugin following the user role. For example to display it if not logged or for B2C and to hide it for B2B (I use the B2BKing plugin to manage bith).
    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    Unfortunately, there is no direct option available in our plugin. However, you can add the below code in your child theme’s functions.php inorder to achieve it.

    add_action( 'admin_menu', 'th_remove_submenu_page_wepo',99999 );
    function th_remove_submenu_page_wepo() {
    $id = get_current_user_id();
        $is_b2b_user = get_the_author_meta( 'b2bking_b2buser', $id );
        if($is_b2b_user == 'yes') {
            remove_submenu_page('edit.php?post_type=product', 'thwepof_extra_product_options');
        }  
    }

    We hope this will help.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Display following user role’ is closed to new replies.