'hero', 'featured' => 'featured-images', 'newarrival' => 'newarrival', 'product_category' => 'collection', 'bestseller' => 'bestseller', 'product_category_grid' => 'collection-grid', 'values' => 'proposition', ); $enabled_section = array(); foreach ( $acoustics_sections as $section => $block ): if( get_theme_mod( 'acoustics_'.$section.'_section_enable' , false ) ){ $enabled_section[] = array( 'section' => $section, 'parts' => $block ); } endforeach; return $enabled_section; } } if( ! function_exists( 'acoustics_footer_social' ) ): function acoustics_footer_social() { $acoustics_twitter_link = get_theme_mod( 'acoustics_twitter_url', '' ); $acoustics_facebook_link = get_theme_mod( 'acoustics_facebook_url', '' ); $acoustics_linkedin_link = get_theme_mod( 'acoustics_linkedin_url', '' ); $acoustics_instagram_link = get_theme_mod( 'acoustics_instagram_url', '' ); $acoustics_pinterest_link = get_theme_mod( 'acoustics_pinterest_url', '' ); $acoustics_youtube_link = get_theme_mod( 'acoustics_youtube_url', '' ); $classes = 'round-icon'; ?> 'System default', 'regularweight' => '400', 'category' => 'sans-serif' ) ); //Get and decode options $body_font = get_theme_mod( 'acoustics_base_font', $defaults ); $menu_font = get_theme_mod( 'acoustics_menu_font', $defaults ); $headings_font = get_theme_mod( 'acoustics_heading_font', $defaults ); $body_font = json_decode( $body_font, true ); $menu_font = json_decode( $menu_font, true ); $headings_font = json_decode( $headings_font, true ); if ( 'System default' === $body_font['font'] && 'System default' === $menu_font['font'] && 'System default' === $headings_font['font'] ) { return; //return early if defaults are active } /** * Font weight loader. * * @since 0.0.1 */ $body_font_weight = str_replace( array( 'regular', 'italic' ), array( '400', '' ), $body_font['regularweight'] ); $menu_font_weight = str_replace( array( 'regular', 'italic' ), array( '400', '' ), $menu_font['regularweight'] ); $heading_font_weight = str_replace( array( 'regular', 'italic' ), array( '400', '' ), $headings_font['regularweight'] ); $font_families = array( $headings_font['font'] . ':wght@' . $heading_font_weight, $menu_font['font'] . ':wght@' . $menu_font_weight, $body_font['font'] . ':wght@' . $body_font_weight ); $fonts_url = add_query_arg( array( 'family' => implode( '&family=', $font_families ), 'display' => 'swap', ), 'https://fonts.googleapis.com/css2' ); // Load google fonts locally $acoustics_googlefont_load_locally = get_theme_mod('acoustics_load_google_fonts_locally', 0); if( $acoustics_googlefont_load_locally ) { require_once get_theme_file_path( 'vendor/wptt-webfont-loader/wptt-webfont-loader.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound add_filter( 'wptt_get_local_fonts_base_path', function( $path ) { $path = wp_upload_dir(); return $path['basedir']; } ); add_filter( 'wptt_get_local_fonts_base_url', function( $url ) { $path = wp_upload_dir(); return $path['baseurl']; } ); add_filter( 'wptt_get_local_fonts_subfolder_name', function( $subfolder_name ) { return 'wp-fonts'; } ); return wptt_get_webfont_url( esc_url_raw( $fonts_url ) ); } return esc_url_raw( $fonts_url ); }