Linux 软件免费装
Banner图

Advanced Custom Fields: Google Font Selector Field

开发者 danielpataki
更新时间 2015年4月28日 13:32
PHP版本: 3.5 及以上
WordPress版本: 4.0
版权: GPLv2 or later
版权网址: 版权信息

标签

google acf fonts

下载

1.0 2.2

详情介绍:

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.

安装:

Installation
  1. Copy the acf-google_font_selector folder into your wp-content/plugins folder
  2. Activate the Google Font Selector plugin via the plugins admin page
  3. Create a new field via ACF and select the Google Font Selector type
  4. Please refer to the description for more info regarding the field type settings
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 );

屏幕截图:

  • ACF control for field creation
  • The user-facing font settings

更新日志:

2.1 2.0 1.0