Created
November 3, 2019 02:48
-
-
Save garvs/b7b6463d69c2e198afbcca070c305120 to your computer and use it in GitHub Desktop.
Restrict Woocommerce reports tab
This file contains 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
<?php | |
add_filter( 'woocommerce_admin_reports', 'restricts_wc_reports_tabs', 10, 1 ); | |
function restricts_wc_reports_tabs( $reports ) { | |
if ( current_user_can( 'manage_woocommerce' ) ) { | |
// do not restrict WooCommerce admin | |
return $reports; | |
} | |
unset( $reports['orders'] ); | |
unset( $reports['customers'] ); | |
// unset( $reports['stock'] ); | |
unset( $reports['taxes'] ); | |
return $reports; | |
} | |
// end of restricts_wc_reports_tabs() |
Hello is this still working? I tried with woocommerce 3.6.2 but it didn't work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The recipe is used at this article.