PluginProbe
Essential Widgets / 1.6
Essential Widgets v1.6
3.2.1 3.3 3.2 trunk 1.0.0 1.0.1 1.1 1.2 1.2.1 1.2.2 1.3 1.4 1.4.1 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.8 1.9 2.0 2.1 2.2 All 31 releases
essential-widgets / public / class-essential-widgets-public.php

class-essential-widgets-public.php in Essential Widgets 1.6, at public/class-essential-widgets-public.php

104 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The public-facing functionality of the plugin.
5 *
6 * @link https://catchplugins.com
7 * @since 1.0.0
8 *
9 * @package Essential_Widgets
10 * @subpackage Essential_Widgets/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 public-facing stylesheet and JavaScript.
18 *
19 * @package Essential_Widgets
20 * @subpackage Essential_Widgets/public
21 * @author Catch Plugins <info@catchplugins.com>
22 */
23 class Essential_Widgets_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 * @param string $plugin_name The name of the plugin.
48 * @param string $version The version of this plugin.
49 */
50 public function __construct( $plugin_name, $version ) {
51
52 $this->plugin_name = $plugin_name;
53 $this->version = $version;
54
55 }
56
57 /**
58 * Register the stylesheets for the public-facing side of the site.
59 *
60 * @since 1.0.0
61 */
62 public function enqueue_styles() {
63
64 /**
65 * This function is provided for demonstration purposes only.
66 *
67 * An instance of this class should be passed to the run() function
68 * defined in Essential_Widgets_Loader as all of the hooks are defined
69 * in that particular class.
70 *
71 * The Essential_Widgets_Loader will then create the relationship
72 * between the defined hooks and the functions defined in this
73 * class.
74 */
75
76 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/essential-widgets-public.css', array(), $this->version, 'all' );
77
78 }
79
80 /**
81 * Register the JavaScript for the public-facing side of the site.
82 *
83 * @since 1.0.0
84 */
85 public function enqueue_scripts() {
86
87 /**
88 * This function is provided for demonstration purposes only.
89 *
90 * An instance of this class should be passed to the run() function
91 * defined in Essential_Widgets_Loader as all of the hooks are defined
92 * in that particular class.
93 *
94 * The Essential_Widgets_Loader will then create the relationship
95 * between the defined hooks and the functions defined in this
96 * class.
97 */
98
99 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/essential-widgets-public.js', array( 'jquery' ), $this->version, false );
100
101 }
102
103 }
104