-
Notifications
You must be signed in to change notification settings - Fork 5
/
acf-rrule.php
executable file
·84 lines (71 loc) · 2 KB
/
acf-rrule.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/*
Plugin Name: ACF RRule Field
Plugin URI: https://github.com/marcbelletre/acf-rrule
Description: Create recurring rules with a single ACF field
Version: 1.5.1
Author: Marc Bellêtre
Author URI: https://pixelparfait.fr
License: MIT
Text Domain: acf-rrule-field
Domain Path: /lang
*/
require_once __DIR__ . '/vendor/autoload.php';
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Check if class already exists
if (!class_exists('acf_plugin_rrule')) :
class acf_plugin_rrule
{
public $settings;
/*
* __construct
*
* This function will setup the class functionality
*
* @type function
* @date 17/02/2016
* @since 1.0.0
*
* @param void
* @return void
*/
public function __construct()
{
// Settings
// - these will be passed into the field class.
$this->settings = [
'version' => '1.5.1',
'url' => plugin_dir_url(__FILE__),
'path' => plugin_dir_path(__FILE__),
];
// Include field
add_action('acf/include_field_types', [$this, 'include_field']);
}
/*
* include_field
*
* This function will include the field type class
*
* @type function
* @date 17/02/2016
* @since 1.0.0
*
* @param $version (int) major ACF version. Defaults to false
* @return void
*/
public function include_field($version = false)
{
// Load ACF RRule
load_plugin_textdomain('acf-rrule-field', false, basename(dirname(__FILE__)) . '/lang');
load_muplugin_textdomain('acf-rrule-field', basename(dirname(__FILE__)) . '/lang');
// Include
include_once 'fields/class-acf-field-rrule.php';
}
}
// Initialize
new acf_plugin_rrule();
// class_exists check
endif;