Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › Disable Woocommerce Webhooks › Reply To: Disable Woocommerce Webhooks
04/06/2015 at 12:37
#1522
Vladimir
Keymaster
Create file wc-settings-remove-tab.php at the wp-content/mu-plugins folder and insert to it this code:
<?php
add_filter( 'woocommerce_settings_tabs_array', 'remove_webhooks', 25);
function remove_webhooks($pages) {
if (current_user_can('wc_manager_restricted')) {
unset($pages['webhooks']);
}
return $pages;
}
Replace wc_manager_restricted with your role name or capability.