Как я могу настроить код, чтобы пользовательский шрифт загружался как по HTTPS, так и по HTTP?
Любая помощь приветствуется!
Код: Выделить всё
// add filter to register custom fonts for font lists
add_filter('gdlr_core_custom_uploaded_font', 'kleanity_register_custom_uploaded_font');
if( !function_exists('kleanity_register_custom_uploaded_font') ){
function kleanity_register_custom_uploaded_font( $custom_fonts ){
$custom_font = kleanity_get_option('typography', 'font-upload');
if( !empty($custom_font) ){
foreach($custom_font as $font_option){
$custom_fonts[$font_option['name']] = array(
'eot' => $font_option['eot'],
'ttf' => $font_option['ttf'],
);
}
}
$custom_fonts['ArcaMojora'] = array(
'name' => 'ArcaMojora',
'eot' => get_template_directory_uri() . '/fonts/ArcaMajora/ArcaMajora3-Bold.eot',
'ttf' => get_template_directory_uri() . '/fonts/ArcaMajora/ArcaMajora3-Bold.ttf',
'font-weight' => 600
);
$custom_fonts['ArcaMojora-Heavy'] = array(
'name' => 'ArcaMojora',
'eot' => get_template_directory_uri() . '/fonts/ArcaMajora/ArcaMajora3-Heavy.eot',
'ttf' => get_template_directory_uri() . '/fonts/ArcaMajora/ArcaMajora3-Heavy.ttf',
'font-weight' => 800,
'varient' => true
);
return $custom_fonts;
} // kleanity_register_custom_uploaded_font
} // function_existsПодробнее здесь: https://stackoverflow.com/questions/547 ... s-protocol
Мобильная версия