-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacf-google-fonts.php
40 lines (33 loc) · 1.34 KB
/
acf-google-fonts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Plugin Name: Advanced Custom Fields: Google Fonts
* Description: A field for Advanced Custom Fields (ACF) allowing users to select fonts from the Google Fonts suite.
* Version: 1.0.1
* Plugin URI: https://github.com/skapecollective/acf-google-fonts/
* Author: Skape Collective
* Author URI: https://skape.co/
* Text Domain: skape
* Network: false
* Requires at least: 5.0.0
* Requires PHP: 7.2
*/
require_once plugin_dir_path( __FILE__ ) . 'source/Autoload.php';
$autoload = new AcfGoogleFonts\Autoload( plugin_dir_path( __FILE__ ) );
$autoload->loadArray( [
'AcfGoogleFonts\\' => 'source'
], 'psr-4' );
// Register global constants
AcfGoogleFonts\Wrappers\Constants::set( 'FILE', __FILE__ );
AcfGoogleFonts\Wrappers\Constants::set( 'DEBUG', defined( 'WP_DEBUG' ) && WP_DEBUG );
AcfGoogleFonts\Wrappers\Constants::set( 'VERSION', '1.0.1' );
AcfGoogleFonts\Wrappers\Constants::set( 'PATH', plugin_dir_path( __FILE__ ) );
AcfGoogleFonts\Wrappers\Constants::set( 'URL', plugin_dir_url( __FILE__ ) );
AcfGoogleFonts\Wrappers\Constants::set( 'BASENAME', plugin_basename( __FILE__ ) );
// Init admin notice controller.
AcfGoogleFonts\Admin\Notices::init();
// Init the admin controller.
AcfGoogleFonts\Controllers\Admin::init();
// Init ACF field > v5
add_action( 'acf/include_field_types', function( $version ) {
new AcfGoogleFonts\Field;
} );