Skip to content

Instantly share code, notes, and snippets.

@andreiglingeanu
Last active February 5, 2024 09:59
Show Gist options
  • Save andreiglingeanu/4d4191d4f0a1af074fc438b38097bc9e to your computer and use it in GitHub Desktop.
Save andreiglingeanu/4d4191d4f0a1af074fc438b38097bc9e to your computer and use it in GitHub Desktop.
<?php
if (! function_exists('write_log')) {
function write_log($log) {
if (is_array($log) || is_object($log)) {
error_log(print_r($log, true));
} else {
error_log($log);
}
}
}
add_filter(
'blocksy_ext_custom_fonts:dynamic_fonts',
function ($fonts) {
write_log([
'action' => 'blocksy_ext_custom_fonts:dynamic_fonts',
'site_url' => get_site_url(),
'font_url' => blc_normalize_site_url(THEME_FONTS_URI . '/Buffalo.woff2')
]);
$fonts[] = [
'name' => 'Buffalo',
'fontType' => 'regular',
'variations' => [
[
'variation' => 'n4',
'url' => blc_normalize_site_url(THEME_FONTS_URI . '/Buffalo.woff2')
],
],
];
return $fonts;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment