PluginProbe
Essential Widgets / trunk
Essential Widgets vtrunk
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 trunk, at public/class-essential-widgets-public.php

108 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly.
5 }
6
7 /**
8 * The public-facing functionality of the plugin.
9 *
10 * @link https://catchplugins.com
11 * @since 1.0.0
12 *
13 * @package Essential_Widgets
14 * @subpackage Essential_Widgets/public
15 */
16
17 /**
18 * The public-facing functionality of the plugin.
19 *
20 * Defines the plugin name, version, and two examples hooks for how to
21 * enqueue the public-facing stylesheet and JavaScript.
22 *
23 * @package Essential_Widgets
24 * @subpackage Essential_Widgets/public
25 * @author Catch Plugins <info@catchplugins.com>
26 */
27 class Essential_Widgets_Public {
28
29 /**
30 * The ID of this plugin.
31 *
32 * @since 1.0.0
33 * @access private
34 * @var string $plugin_name The ID of this plugin.
35 */
36 private $plugin_name;
37
38 /**
39 * The version of this plugin.
40 *
41 * @since 1.0.0
42 * @access private
43 * @var string $version The current version of this plugin.
44 */
45 private $version;
46
47 /**
48 * Initialize the class and set its properties.
49 *
50 * @since 1.0.0
51 * @param string $plugin_name The name of the plugin.
52 * @param string $version The version of this plugin.
53 */
54 public function __construct( $plugin_name, $version ) {
55
56 $this->plugin_name = $plugin_name;
57 $this->version = $version;
58
59 }
60
61 /**
62 * Register the stylesheets for the public-facing side of the site.
63 *
64 * @since 1.0.0
65 */
66 public function enqueue_styles() {
67
68 /**
69 * This function is provided for demonstration purposes only.
70 *
71 * An instance of this class should be passed to the run() function
72 * defined in Essential_Widgets_Loader as all of the hooks are defined
73 * in that particular class.
74 *
75 * The Essential_Widgets_Loader will then create the relationship
76 * between the defined hooks and the functions defined in this
77 * class.
78 */
79
80 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/essential-widgets-public.css', array(), $this->version, 'all' );
81
82 }
83
84 /**
85 * Register the JavaScript for the public-facing side of the site.
86 *
87 * @since 1.0.0
88 */
89 public function enqueue_scripts() {
90
91 /**
92 * This function is provided for demonstration purposes only.
93 *
94 * An instance of this class should be passed to the run() function
95 * defined in Essential_Widgets_Loader as all of the hooks are defined
96 * in that particular class.
97 *
98 * The Essential_Widgets_Loader will then create the relationship
99 * between the defined hooks and the functions defined in this
100 * class.
101 */
102
103 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/essential-widgets-public.js', array( 'jquery' ), $this->version, true );
104
105 }
106
107 }
108