Posts by pdclark

1 post
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
  • Located in United States
pdclark says

I was needing this recently for the Styles plugin, and I noticed that phat-reaction.com/googlefonts.php was fairly out-of-date.

As a solution, I wrote a WordPress plugin that can run independently for testing, or as an include in any other plugins and themes. You can read more about it and see a screenshot on Github: github.com/stylesplugin/styles-font-dropdown.

This drop-in class has several nice features:
  • Automatic updates: Updates from Google’s Font API automatically, caching for 15 days. (Interval can be changed.)
  • Search and style the menu: Uses the Chosen library, allowing users to search the font list and you to style as you’d like.
  • Degrades gracefully: If you don’t set a Google Fonts API for yourself or your users, it falls back to a Google Font list stored in the plugin
  • Deploy with or without an API key: If you set a Google Fonts API on your development machine, it will update the cache file for you to deploy to your users.

I’d be happy to hear your input. If you run into any issues, please report it on Github. I hope to include it in the Styles plugin for all themes in the near future.

by
by
by
by
by
by