Created
August 20, 2018 11:21
-
-
Save wpweb101/beddc844e5c55973089b60ae9a588880 to your computer and use it in GitHub Desktop.
WooCommerce Pdf Vouchers - Code to remove Voucher status Widget area from the admin dashboard for Voucher Vendor role
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // code to remove WooCommerce Pdf Voucher dashboard widget | |
| global $woo_vou_admin; | |
| if( is_user_logged_in() ){ | |
| $user = wp_get_current_user(); | |
| // woo_vou_vendors you can change user role if you want to remove dashboard for any other role | |
| if( !empty( $user ) && in_array( 'woo_vou_vendors' , $user->roles ) ) { | |
| remove_action('wp_dashboard_setup', array( $woo_vou_admin,'woo_vou_add_dashboard_widgets') ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment