-
Notifications
You must be signed in to change notification settings - Fork 0
/
acf-date_time_picker.php
executable file
·61 lines (51 loc) · 1.47 KB
/
acf-date_time_picker.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
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
Plugin Name: Date & Time Picker for Advanced Custom Fields
Plugin URI: https://github.com/toszcze/acf-date-time-picker
Description: Date & Time Picker field for Advanced Custom Fields 4 and 5 (Pro)
Version: 1.1.3
Author: Bartosz Romanowski
Author URI: http://romanowski.im/
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: acf-date-time-picker
Domain Path: /languages/
*/
// exit if accessed directly
if(!defined('ABSPATH')) exit;
if(!defined('ACF_DTP_VERSION')) {
define('ACF_DTP_VERSION', '1.1.3');
}
if(!defined('ACF_DTP_URL')) {
define('ACF_DTP_URL', plugin_dir_url(__FILE__));
}
if(!class_exists('acf_plugin_date_time_picker')):
class acf_plugin_date_time_picker {
/**
* Class constructor
*
* @since 1.0.0
*/
public function __construct() {
load_plugin_textdomain('acf-date-time-picker', false, plugin_basename(dirname(__FILE__)).'/languages');
add_action('acf/include_field_types', array($this, 'include_field_types')); // ACF5
add_action('acf/register_fields', array($this, 'include_field_types')); // ACF4
}
/**
* Include the field type class
*
* @since 1.0.0
*
* @param integer $version Major ACF version; defaults to 4
*/
public function include_field_types($version = 4) {
if(empty($version)) {
$version = 4;
}
include_once('fields/acf-date_time_picker-common.php');
include_once('fields/acf-date_time_picker-v'.$version.'.php');
}
}
// initialize plugin
new acf_plugin_date_time_picker();
endif;