Git Product home page Git Product logo

acf-google_font_selector's Introduction

ACF Google Font Selector Field

Welcome to the the Google Font Selector Field for Advanced Custom Fields.

This plugin allows you to create a Google font selector field with different options. The plugin also creates the font request in the theme header. Font variants and charsets can be selected separately to make font loading more flexible and optimized.

Font options added to any options page will always be enqueues. Any fonts added to post pages will only be enqueued when that specific post is displayed.

This ACF field type is compatible with ACF 4 and ACF 5.

Usage

Once installed the list of Google Fonts will be retrieved from a static file included in the plugin. If you would like the list to be pulled from the Google API you will need to define your API key. You can do this in the theme's function file for example.

define( 'ACFGFS_API_KEY', 'your_google_api_key' );

It's super easy to get an API key, just head on over to the Google API Console, create a new project and get a browser api key.

The ACFGFS_REFRESH constant can also be defined, it controls how frequently the plugin checks the Google API for updates. The value is in seconds, 86400 would be a day. The default is set to 3 days.

define( 'ACFGFS_REFRESH', 259200 );

If you would like to disable the automatic enqueueing of fonts you can use the ACFGFS_NOENQUEUE constant. The fonts are only enqueued automatically when this constant is not defined. Define the constant to disable enqueueing.

define( 'ACFGFS_NOENQUEUE', true );


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.