forked from airesvsg/acf-youtubepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacf-youtubepicker.php
48 lines (36 loc) · 1.13 KB
/
acf-youtubepicker.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
41
42
43
44
45
46
47
48
<?php
/*
Plugin Name: Advanced Custom Fields: YouTube Picker
Plugin URI: https://github.com/airesvsg/acf-youtubepicker
Description: Search and select videos on YouTube without leaving the page
Version: 3.2.1
Author: Aires Gonçalves
Author URI: https://github.com/airesvsg
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
if( ! defined( 'ABSPATH' ) ) {
exit;
}
if( !class_exists( 'acf_plugin_youtubepicker' ) ) {
class acf_plugin_youtubepicker {
function __construct() {
$this->settings = array(
'version' => '3.2.1',
'url' => plugin_dir_url( __FILE__ ),
'path' => plugin_dir_path( __FILE__ ),
);
add_action( 'acf/include_field_types', array( $this, 'include_field_types' ) ); // v5
add_action( 'acf/register_fields', array( $this, 'include_field_types' ) ); // v4
include_once 'includes/youtubepicker.php';
}
function include_field_types( $version ) {
if ( ! is_numeric( $version ) ) {
$version = 4;
}
$this->settings['acf_version'] = absint( $version );
include_once 'fields/acf-youtubepicker.php';
}
}
new acf_plugin_youtubepicker();
}