woocommerce_disable_admin_bar

woocommerce_disable_admin_bar

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('woocommerce_disable_admin_bar') is found 2 times:

  • /includes/admin/class-wc-admin.php line 162
    			 * This filter is documented in ../wc-user-functions.php
    			 *
    			 * @since 3.6.0
    			 */
    			apply_filters( 'woocommerce_disable_admin_bar', true )
    			&& isset( $_SERVER['SCRIPT_FILENAME'] )
    			&& ! in_array( basename( sanitize_text_field( wp_unslash( $_SERVER['SCRIPT_FILENAME'] ) ) ), $exempted_paths, true )
    		) {
    			$has_cap     = false;
    			$access_caps = array( 'edit_posts', 'manage_woocommerce', 'view_admin_dashboard' );
    
    
  • /includes/wc-user-functions.php line 33
    	 * @since 3.0.0
    	 *
    	 * @param bool $enabled
    	 */
    	if ( apply_filters( 'woocommerce_disable_admin_bar', true ) && ! ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_woocommerce' ) ) ) {
    		$show_admin_bar = false;
    	}
    
    	return $show_admin_bar;
    }
    add_filter( 'show_admin_bar', 'wc_disable_admin_bar', 10, 1 ); // phpcs:ignore WordPress.VIP.AdminBarRemoval.RemovalDetected