文件操作 - woocommerce.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/integration/woocommerce.php
编辑文件内容
<?php namespace TotalTheme\Integration; \defined( 'ABSPATH' ) || exit; /** * WooCommerce Integration. */ class WooCommerce { /** * Static-only class. */ private function __construct() {} /** * Hook into actions and filters. */ public static function init() { \add_action( 'wp_enqueue_scripts', [ self::class, 'register_scripts' ] ); if ( self::is_advanced_mode() ) { totaltheme_init_class( __NAMESPACE__ . '\WooCommerce\Setup\Advanced' ); } else { totaltheme_init_class( __NAMESPACE__ . '\WooCommerce\Setup\Vanilla' ); } // Global hooks. \add_filter( 'body_class', [ self::class, 'filter_body_class' ] ); \add_filter( 'totaltheme/header/menu/search/form_args', [ self::class, 'filter_header_searchform_args'] ); \add_filter( 'totaltheme/overlays/styles', [ self::class, 'filter_overlay_styles' ] ); \add_filter( 'is_woocommerce', [ self::class, 'filter_is_woocommerce' ] ); } /** * Checks if advanced integration is enabled. */ public static function is_advanced_mode(): bool { if ( ! self::is_advanced_mode_supported() ) { return false; } $check = get_theme_mod( 'woocommerce_integration', true ); /** * Filtes whether advanced integration is enabled or not. */ $check = apply_filters( 'totaltheme/integration/woocommerce/is_advanced_mode', $check ); /*** deprecated ***/ $check = apply_filters( 'wpex_has_woo_mods', $check ); return (bool) $check; } /** * Checks if advanced mode is supported. */ public static function is_advanced_mode_supported(): bool { return defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '3.0.0', '>=' ); } /** * Hooks into wp_enqueue_scripts. */ public static function register_scripts(): void { \wp_register_script( 'wpex-wc-cart-dropdown', \totaltheme_get_js_file( 'frontend/woocommerce/cart-dropdown' ), [ \WPEX_THEME_JS_HANDLE ], \WPEX_THEME_VERSION, true ); \wp_register_script( 'wpex-wc-cart-overlay', \totaltheme_get_js_file( 'frontend/woocommerce/cart-overlay' ), [ \WPEX_THEME_JS_HANDLE ], \WPEX_THEME_VERSION, true ); } /** * Hooks into the "body_class" hook. */ public static function filter_body_class( $class ) { if ( \get_theme_mod( 'woo_product_responsive_tabs', false ) && \is_singular( 'product' ) ) { $class[] = 'woo-single-responsive-tabs'; } if ( \get_theme_mod( 'woo_checkout_single_col', false ) && is_checkout() ) { $class[] = 'wpex-fw-checkout'; } return $class; } /** * Filters the header search form args. */ public static function filter_header_searchform_args( array $args ): array { if ( \get_theme_mod( 'woo_header_product_searchform', false ) ) { $args['post_type'] = 'product'; } return $args; } /** * Adds new overlay styles. */ public static function filter_overlay_styles( array $styles ): array { return \array_merge( $styles, [ 'title-price-hover' => [ 'name' => \esc_html__( 'Title + Price Hover', 'total' ), ], ] ); } /** * Hooks into "is_woocommerce". */ public static function filter_is_woocommerce( $check ): bool { if ( \totaltheme_is_integration_active( 'post_types_unlimited' ) ) { if ( is_tax() && \wpex_get_ptu_tax_mod( \get_query_var( 'taxonomy' ), 'template_id' ) ) { $check = false; } } return (bool) $check; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件