woocommerce_disable_admin_bar
Controls whether the WooCommerce admin bar should be disabled.
Использование
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)
- -
Список изменений
| С версии 3.0.0 | Введена. |
Где вызывается хук
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 188
apply_filters( 'woocommerce_disable_admin_bar', true )