wordpress dashboard access block for vendor

WCMp Vendor Frontend Reports

wordpress dashboard access block for vendor Resolved

Viewing 2 reply threads
  • Author
    Posts
    • #50366
      Mian Irfan
      Participant

      Hye,
      I want to stop vendors to access WP backend dashboard from frontend options and you provided me a code.
      add_action( ‘init’, ‘blockusers_init’ );
      function blockusers_init() {
      if ( is_admin() && ! current_user_can( ‘administrator’ ) &&
      ! ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {
      wp_redirect( home_url() );
      exit;
      }
      }
      If I use this code then only admin can access WP dashboard and no one other can access it like editors and authors and shop managers.
      I only want vendors to stop accessing WP dashboards from frontend.
      Kindly give me code with I can Only Stop Vendors.
      Or I can remove the option of WordPress dashboard from frontend options.
      Thanks

    • #50405

      @Mian Irfan, currently we don’t have any ready made code for vendor’s only, so you need to add checking, whether a current user is a dc_vendor modify the above code.

      Alternatively, you may use WCMp Advance Frontend Manager (https://wc-marketplace.com/product/wcmp-frontend-manager/) and activate the option “Disallow Vendors wp-admin Access” (see this screenshot – https://prnt.sc/m4fb2i)

      Let us know if you have any further query.

    • #55361
      Anonymous
      Inactive

      Hi Mian Irfan,

      Since we did not hear back from you, we presume that you are no longer facing this issue. Hence we are closing this thread. Please open a new thread in case of any issue.

      Thanks!

Viewing 2 reply threads

The topic ‘wordpress dashboard access block for vendor’ is closed to new replies.

COVID-19 Outbreak: WCMp team is supporting business affected by coronavirus

Read the Message Buy at Slashed Price