|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* The public-facing functionality of the plugin. |
|
5
|
|
|
* |
|
6
|
|
|
* @link http://www.thinkovi.com |
|
7
|
|
|
* @since 1.0.0 |
|
8
|
|
|
* |
|
9
|
|
|
* @package Xcloner |
|
10
|
|
|
* @subpackage Xcloner/public |
|
11
|
|
|
*/ |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* The public-facing functionality of the plugin. |
|
15
|
|
|
* |
|
16
|
|
|
* Defines the plugin name, version, and two examples hooks for how to |
|
17
|
|
|
* enqueue the admin-specific stylesheet and JavaScript. |
|
18
|
|
|
* |
|
19
|
|
|
* @package Xcloner |
|
20
|
|
|
* @subpackage Xcloner/public |
|
21
|
|
|
* @author Liuta Ovidiu <[email protected]> |
|
22
|
|
|
*/ |
|
23
|
|
|
class Xcloner_Public { |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* The ID of this plugin. |
|
27
|
|
|
* |
|
28
|
|
|
* @since 1.0.0 |
|
29
|
|
|
* @access private |
|
30
|
|
|
* @var string $plugin_name The ID of this plugin. |
|
31
|
|
|
*/ |
|
32
|
|
|
private $plugin_name; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* The version of this plugin. |
|
36
|
|
|
* |
|
37
|
|
|
* @since 1.0.0 |
|
38
|
|
|
* @access private |
|
39
|
|
|
* @var string $version The current version of this plugin. |
|
40
|
|
|
*/ |
|
41
|
|
|
private $version; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Initialize the class and set its properties. |
|
45
|
|
|
* |
|
46
|
|
|
* @since 1.0.0 |
|
47
|
|
|
* |
|
48
|
|
|
*/ |
|
49
|
|
|
public function __construct(Xcloner $xcloner_container) { |
|
50
|
|
|
|
|
51
|
|
|
$this->plugin_name = $xcloner_container->get_plugin_name(); |
|
52
|
|
|
$this->version = $xcloner_container->get_version(); |
|
53
|
|
|
|
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Register the stylesheets for the public-facing side of the site. |
|
58
|
|
|
* |
|
59
|
|
|
* @since 1.0.0 |
|
60
|
|
|
*/ |
|
61
|
|
|
public function enqueue_styles() { |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* This function is provided for demonstration purposes only. |
|
65
|
|
|
* |
|
66
|
|
|
* An instance of this class should be passed to the run() function |
|
67
|
|
|
* defined in Xcloner_Loader as all of the hooks are defined |
|
68
|
|
|
* in that particular class. |
|
69
|
|
|
* |
|
70
|
|
|
* The Xcloner_Loader will then create the relationship |
|
71
|
|
|
* between the defined hooks and the functions defined in this |
|
72
|
|
|
* class. |
|
73
|
|
|
*/ |
|
74
|
|
|
|
|
75
|
|
|
wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/xcloner-public.css', array(), $this->version, 'all'); |
|
76
|
|
|
|
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* Register the JavaScript for the public-facing side of the site. |
|
81
|
|
|
* |
|
82
|
|
|
* @since 1.0.0 |
|
83
|
|
|
*/ |
|
84
|
|
|
public function enqueue_scripts() { |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* This function is provided for demonstration purposes only. |
|
88
|
|
|
* |
|
89
|
|
|
* An instance of this class should be passed to the run() function |
|
90
|
|
|
* defined in Xcloner_Loader as all of the hooks are defined |
|
91
|
|
|
* in that particular class. |
|
92
|
|
|
* |
|
93
|
|
|
* The Xcloner_Loader will then create the relationship |
|
94
|
|
|
* between the defined hooks and the functions defined in this |
|
95
|
|
|
* class. |
|
96
|
|
|
*/ |
|
97
|
|
|
|
|
98
|
|
|
wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/xcloner-public.js', array('jquery'), $this->version, false); |
|
99
|
|
|
|
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
} |
|
103
|
|
|
|