ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
924 stars 218 forks source link

googleapis_webfonts_url does not work anymore #4217

Closed goran468 closed 2 years ago

goran468 commented 2 years ago

The default link webfonts link: https://google-webfonts-cache.unyson.io/v1/webfonts

returns

"API key not valid. Please pass a valid API key.".

Could you update the API key on your side please? It is possible to create a standalone solution, but for old sites which are using default Unyson webfonts url it could lead to the problem.

Thank you in advance.

onebelarusianguy commented 2 years ago
/**
 * Make Google fonts work again
 */
if ( !function_exists( 'nowadays_filter_fw_googleapis_webfonts_url' ) ) :
    function nowadays_filter_fw_googleapis_webfonts_url() {
        return 'https://www.googleapis.com/webfonts/v1/webfonts?key=XXXXX';
    }
endif;

add_filter('fw_googleapis_webfonts_url', 'nowadays_filter_fw_googleapis_webfonts_url');

where XXXXX is your API key.