No results found. Try again with different words?

Search must be at least 3 characters.

Deprecated Google Fonts Filter

From the Astra theme version 2.5.0, we are making some changes on how the Google Fonts file will be served. Previously, this used to cause a rare error with WP_Filesystem() on some servers.

For the same, we are deprecating the filter: astra_google_fonts_json_file

Now, instead of the above filter, users will now be using new filter: astra_google_fonts_php_file

Note: For users who are getting this PHP Notice after the update –

Deprecated: astra_google_fonts_json_file is deprecated since version 2.5.0! Use instead. `astra_google_fonts_php_file`.


If you need to switch their Google Fonts file from JSON to PHP you can simply do it using this new filter –

add_filter('astra_google_fonts_php_file', 'asrta_add_new_google_php_file');

function asrta_add_new_google_php_file() {
    return get_stylesheet_directory() . '/google-new-fonts.php';
}

And here’s the link to the demo fonts file and the array how you should add and insert new Google fonts. You can modify the file path in the above filter based on the file name – google-new-fonts.php.

Note: Add the above code into the child theme’s functions.php file.

Was this article helpful?
Did not find a solution? We are here to help you succeed.

Related Docs

Astra is Free. Now & Forever.

We believe creating beautiful websites should not be expensive. That's why Astra is free for everyone. Get started for free and extend with affordable packages.

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form