woocommerce_enqueue_styles
Filter list of WooCommerce styles to enqueue.
Использование
add_filter( 'woocommerce_enqueue_styles', 'wp_kama_woocommerce_enqueue_styles_filter' ); /** * Function for `woocommerce_enqueue_styles` filter-hook. * * @param array $array List of default WooCommerce styles. * * @return array */ function wp_kama_woocommerce_enqueue_styles_filter( $array ){ // filter... return $array; }
- $array(массив)
- List of default WooCommerce styles.
Список изменений
С версии 2.1.0 | Введена. |
Где вызывается хук
woocommerce_enqueue_styles
woocommerce/includes/class-wc-frontend-scripts.php 67-99
$styles = apply_filters( 'woocommerce_enqueue_styles', array( 'woocommerce-layout' => array( 'src' => self::get_asset_url( 'assets/css/woocommerce-layout.css' ), 'deps' => '', 'version' => $version, 'media' => 'all', 'has_rtl' => true, ), 'woocommerce-smallscreen' => array( 'src' => self::get_asset_url( 'assets/css/woocommerce-smallscreen.css' ), 'deps' => 'woocommerce-layout', 'version' => $version, 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')', 'has_rtl' => true, ), 'woocommerce-general' => array( 'src' => self::get_asset_url( 'assets/css/woocommerce.css' ), 'deps' => '', 'version' => $version, 'media' => 'all', 'has_rtl' => true, ), 'woocommerce-blocktheme' => wc_current_theme_is_fse_theme() ? array( 'src' => self::get_asset_url( 'assets/css/woocommerce-blocktheme.css' ), 'deps' => '', 'version' => $version, 'media' => 'all', 'has_rtl' => true, ) : false, ) );
Где используется хук в WooCommerce
woocommerce/includes/theme-support/class-wc-twenty-nineteen.php 34
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
woocommerce/includes/theme-support/class-wc-twenty-seventeen.php 27
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
woocommerce/includes/theme-support/class-wc-twenty-twenty-one.php 31
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
woocommerce/includes/theme-support/class-wc-twenty-twenty-three.php 27
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
woocommerce/includes/theme-support/class-wc-twenty-twenty-two.php 27
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
woocommerce/includes/theme-support/class-wc-twenty-twenty.php 34
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );