Class for building Google Font String

This morning I had an idea. The code is now written and somewhat tested and appears to be production ready.

It’s a PHP class that theme developers can use to add Google Fonts to their theme, which defaults to using Google as the source, but allows the blogmaster to specify an alternate source just by adding a single line to their wp-config.php file:

define('WEBFONT_MIRROR', 'whatever.org');

That would cause whatever.org to be used instead of fonts.googleapi.com.

The domain whatever.org would still have to understand the Google Fonts GET variables and have a mirror of the fonts, but it works.

The code is here: https://gist.github.com/AliceWonderMiscreations/b0071e48a27a536142ce38bf6868336b

Sexy women by large letter blocks that spell pixabay

Leave a Reply

Your email address will not be published. Required fields are marked *

Anonymity protected with AWM Pluggable Unplugged