Deactivate the WCFM sidebar menu only in non administrator accounts

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Marketplace (WooCommerce Multivendor Marketplace) Deactivate the WCFM sidebar menu only in non administrator accounts

Viewing 4 reply threads
  • Author
    Posts
    • #68547
      darq roya
      Participant

      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.
    • #68781
      darq roya
      Participant

      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.

    • #68844
      ing.rapparini
      Participant

      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 );

    • #68996
      WCFM Forum
      Member

      @darq roya, it’s the right code for the purpose.

      You may use this.

      Thank You

    • #69082
      darq roya
      Participant

      Perfect ing.rapparini you are a genius, that’s what I was looking for, thank you very much!

Viewing 4 reply threads
  • The topic ‘Deactivate the WCFM sidebar menu only in non administrator accounts’ is closed to new replies.