$font_family ) { $font_families_str .= ( $index === 0 ? 'family=' : '&family=' ) . $font_family; } $query_args = $font_families_str; if ( ! empty( $settings ) ) { $query_args .= '&subset=' . implode( ',', $settings ); } $fonts_url = 'https://fonts.googleapis.com/css2?' . $query_args; return esc_url_raw( $fonts_url ); } // Enqueue Frontend public static function aldstore_dropshipping_for_aliexpress_scripts() { wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_style( 'yith-wcwl-font-awesome' ); wp_dequeue_style( 'yith-quick-view' ); wp_dequeue_script( 'yith-wcwl-add-to-wishlist' ); wp_dequeue_script( 'yith-wcwl-add-to-wishlist-gutenberg' ); /* Theme stylesheet. */ wp_enqueue_style( 'aldstore-dropshipping-for-aliexpress-fonts', self::aldstore_dropshipping_for_aliexpress_fonts_google(), array(), null ); wp_enqueue_style( 'bootstrap-grid', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/bootstrap-grid.min.css', array(), '5.2.3' ); wp_enqueue_style( 'bootstrap-reboot', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/bootstrap-reboot.min.css', array(), '5.2.3' ); wp_enqueue_style( 'swiper-bundle', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/swiper-bundle.min.css', array(), '11.0.5' ); wp_enqueue_style( 'font-awesome', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/font-awesome.min.css', array(), '4.7.0' ); wp_enqueue_style( 'aldstore-dropshipping-for-aliexpress-style', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/style.css', array(), ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_VERSION, 'all' ); wp_enqueue_style( 'aldstore-dropshipping-for-aliexpress-woocommerce-alidropship', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/pluggable/woocommerce-alidropship.css', array(), ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_VERSION, 'all' ); if ( class_exists( 'YITH_WCQV_Frontend' ) ) { wp_enqueue_style( 'aldstore-yith-woocommerce-quick-view', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/pluggable/yith-woocommerce-quick-view.css', array(), ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_VERSION, 'all' ); } if ( defined( 'YITH_WCWL' ) ) { wp_enqueue_style( 'aldstore-dropshipping-for-aliexpress-yith-woocommerce-wishlist', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/pluggable/yith-woocommerce-wishlist.css', array(), ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_VERSION, 'all' ); } if ( class_exists( 'WOO_PRODUCT_COMPARE_ACTIVE' ) ) { wp_enqueue_style( 'aldstore-dropshipping-for-aliexpress-compe-woo-compare-products', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/pluggable/compe-woo-compare-products.css', array(), ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_VERSION, 'all' ); } if ( class_exists( 'WOOMULTI_CURRENCY_F' ) ) { wp_enqueue_style( 'aldstore-dropshipping-for-aliexpress-woo-multi-currency', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/css/pluggable/woo-multi-currency.css', array(), ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_VERSION, 'all' ); } if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( ! is_admin() ) { wp_dequeue_style( 'woocommerce_admin_styles' ); } wp_enqueue_script( 'swiper-bundle', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/js/swiper-bundle.min.js', array( 'jquery' ), '11.0.5', true ); wp_enqueue_script( 'aldstore-dropshipping-for-aliexpress-frontend', ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_THEME_URI . '/assets/js/frontend.js', array( 'jquery' ), ALDSTORE_DROPSHIPPING_FOR_ALIEXPRESS_VERSION, true ); } public static function aldstore_dropshipping_for_aliexpress_inline_css() { $css = ''; $elements = array( 'body', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ); $primary_color = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_primary_color', '#060E30' ); $secondary_color = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_secondary_color', '#F5C000' ); $header_logo_width = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_header_logo_width', 150 ); $header_logo_mobile_width = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_header_logo_mobile_width', 100 ); $footer_logo_width = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_footer_logo_width', 150 ); $footer_logo_mobile_width = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_footer_logo_mobile_width', 100 ); $footer_payment_width = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_footer_payment_width', 280 ); $enable_shop_fullwidth = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_enable_shop_fullwidth' ); $enable_product_fullwidth = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_enable_product_fullwidth' ); foreach ( $elements as $el ) { $font_family = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( "aldstore_dropshipping_for_aliexpress_{$el}_font_family", '' ); $font_size = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( "aldstore_dropshipping_for_aliexpress_{$el}_font_size", '' ); $line_height = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( "aldstore_dropshipping_for_aliexpress_{$el}_line_height", '' ); $color = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( "aldstore_dropshipping_for_aliexpress_{$el}_color", '' ); $style = ''; if ( $font_family ) { $style .= "font-family: " . esc_attr( $font_family ) . ", sans-serif;"; } if ( $font_size ) { $style .= "font-size: " . esc_attr( $font_size ) . "px;"; } if ( $line_height ) { $style .= "line-height: " . esc_attr( $line_height ) . ";"; } if ( $color ) { $style .= "color: " . esc_attr( $color ) . ";"; } if ( $style ) { $css .= "{$el} { {$style} }"; } } $css .= ' :root { --aldstore-primary-color: ' . esc_attr( $primary_color ) . '; --aldstore-secondary-color: ' . esc_attr( $secondary_color ) . '; } '; if ( ! empty( $header_logo_width ) ) { $css .= ' .header-desktop .header-logo img { width: ' . esc_attr( $header_logo_width ) . 'px; } '; } if ( ! empty( $header_logo_mobile_width ) ) { $css .= ' .header-mobile .header-logo img { width: ' . esc_attr( $header_logo_mobile_width ) . 'px; } '; } if ( ! empty( $footer_logo_width ) ) { $css .= ' .footer .footer-logo img { width: ' . esc_attr( $footer_logo_width ) . 'px; } '; } if ( ! empty( $footer_logo_mobile_width ) ) { $css .= ' @media(max-width:767px) { .footer .footer-logo img { width: ' . esc_attr( $footer_logo_mobile_width ) . 'px; } } '; } if ( ! empty( $footer_payment_width ) ) { $css .= ' .footer .footer-payment img { width: ' . esc_attr( $footer_payment_width ) . 'px; } '; } if ( ! empty( $enable_shop_fullwidth ) ) { $css .= ' .woocommerce-page.archive .container { max-width: 100%; } '; } if ( ! empty( $enable_product_fullwidth ) ) { $css .= ' .woocommerce-page.single-product .container { max-width: 100%; } '; } $content = preg_replace( '/\s+/', ' ', $css ); wp_add_inline_style( 'aldstore-dropshipping-for-aliexpress-style', $content ); } } }