woocommerce_disable_admin_bar
Controls whether the WooCommerce admin bar should be disabled.
Usage
add_filter( 'woocommerce_disable_admin_bar', 'wp_kama_woocommerce_disable_admin_bar_filter' ); /** * Function for `woocommerce_disable_admin_bar` filter-hook. * * @param bool $enabled * * @return bool */ function wp_kama_woocommerce_disable_admin_bar_filter( $enabled ){ // filter... return $enabled; }
- $enabled(true|false)
- -
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
woocommerce_disable_admin_bar
woocommerce_disable_admin_bar
woocommerce/includes/wc-user-functions.php 34
if ( apply_filters( 'woocommerce_disable_admin_bar', true ) && ! ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_woocommerce' ) ) ) {
woocommerce/includes/admin/class-wc-admin.php 164
apply_filters( 'woocommerce_disable_admin_bar', true )