Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Deactivate the WCFM sidebar menu only in non administrator accounts
Tagged: Deactivate sidebar menu
- This topic has 4 replies, 3 voices, and was last updated 5 years, 4 months ago by darq roya.
- AuthorPosts
- June 19, 2019 at 9:25 am #68547darq royaParticipant
Hi!
First of all, although many people here are talking about them all the time, it never hurts to repeat it once again, excellent plugin! and what I’m seeing every day is improving.
The issue is simple I need to hide the left sidebar only in frontend (non administrator accounts) and not in backend (administrator accounts), but when selecting the option I hide in both areas, is there a way to achieve this?
Thanks!
Attachments:
You must be logged in to view attached files. - June 20, 2019 at 6:05 pm #68781darq royaParticipant
Hi!
I see that the answer is not as simple as I thought, it’s been almost 2 days and nobody has answered I guess I’ll have to implement some ingenious solution to disable the wcfm sidebar using CSS and get the role using something similar to this that I got :
function get_current_user_roles() { if( is_user_logged_in() ) { $user = wp_get_current_user(); $roles = ( array ) $user->roles; return $roles; // This returns an array // Use this to return a single value // return $roles[0]; } else { return array(); } }
Thank you very much for the effort.
- June 21, 2019 at 7:34 am #68844ing.rappariniParticipant
I had the same need and they sent me this line to add at child theme’s functions.php
add_filter (‘wcfm_is_allow_show_menu’, function($menu, $end_point)
{if( function_exists(‘wcfm_is_vendor’) && wcfm_is_vendor())
{$menu = false;} return $menu;}, 50, 2 ); - June 22, 2019 at 4:34 am #68996WCFM ForumMember
@darq roya, it’s the right code for the purpose.
You may use this.
Thank You
- June 22, 2019 at 11:26 pm #69082darq royaParticipant
Perfect ing.rapparini you are a genius, that’s what I was looking for, thank you very much!
- AuthorPosts
- The topic ‘Deactivate the WCFM sidebar menu only in non administrator accounts’ is closed to new replies.