PluginProbe
Borderless – Addons and Templates for Elementor / 1.1.9
Borderless – Addons and Templates for Elementor v1.1.9
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / includes / class-borderless.php

class-borderless.php in Borderless – Addons and Templates for Elementor 1.1.9, at includes/class-borderless.php

165 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The file that defines the core plugin class
5 *
6 * A class definition that includes attributes and functions used across both the
7 * public-facing side of the site and the admin area.
8 */
9
10 class Borderless {
11
12 /**
13 * The loader that's responsible for maintaining and registering all hooks that power
14 * the plugin.
15 *
16 * @since 1.0.0
17 * @access protected
18 * @var Borderless_Loader $loader Maintains and registers all hooks for the plugin.
19 */
20 protected $loader;
21
22 /**
23 * The unique identifier of this plugin.
24 *
25 * @since 1.0.0
26 * @access protected
27 * @var string $plugin_name The string used to uniquely identify this plugin.
28 */
29 protected $plugin_name;
30
31 /**
32 * The current version of the plugin.
33 *
34 * @since 1.0.0
35 * @access protected
36 * @var string $version The current version of the plugin.
37 */
38 protected $version;
39
40 /**
41 * Define the core functionality of the plugin.
42 *
43 * Set the plugin name and the plugin version that can be used throughout the plugin.
44 * Load the dependencies, define the locale, and set the hooks for the admin area and
45 * the public-facing side of the site.
46 *
47 * @since 1.0.0
48 */
49 public function __construct() {
50
51 if ( defined( 'BORDERLESS__VERSION' ) ) {
52 $this->version = BORDERLESS__VERSION;
53 } else {
54 $this->version = '1.0.0';
55 }
56 $this->plugin_name = 'borderless';
57
58 $this->borderless_load_dependencies();
59 $this->borderless_define_public_hooks();
60
61 }
62
63 /**
64 * Define the core functionality of the plugin.
65 *
66 * Set the plugin name and the plugin version that can be used throughout the plugin.
67 * Load the dependencies, define the locale, and set the hooks for the admin area and
68 * the public-facing side of the site.
69 *
70 * @since 1.0.0
71 */
72
73 public function borderless_load_dependencies() {
74
75 $options = get_option( 'borderless' );
76
77 /**
78 * The class responsible for orchestrating the actions and filters of the
79 * core plugin.
80 */
81 require_once( BORDERLESS__INC . "/class-borderless-loader.php" );
82
83 /**
84 * The class responsible for defining all actions that occur in the public-facing
85 * side of the site.
86 */
87 require_once( BORDERLESS__INC . "/class-borderless-public.php" );
88
89 require_once( BORDERLESS__INC . "/templates/dashboard.php" );
90 require_once( BORDERLESS__INC . "/templates/system-info.php" );
91 require_once( BORDERLESS__INC . "/icon-manager/icon-manager.php" );
92 require_once( BORDERLESS__INC . "/custom-post-types/custom-post-types.php" );
93 require_once( BORDERLESS__INC . "/svg/svg.php" );
94 require_once( BORDERLESS__WPBAKERY . "/wpbakery.php" );
95 require_once( BORDERLESS__INC . "/widgets/button.php" );
96 require_once( BORDERLESS__INC . "/helper.php" );
97
98 if ( isset( $options['elementor'] ) ) {
99 require_once( BORDERLESS__ELEMENTOR . "/elementor.php" );
100 }
101 if ( isset( $options['related_posts'] ) ) {
102 require_once( BORDERLESS__RELATED_POSTS . "/related-posts.php" );
103 }
104
105 $this->loader = new Borderless_Loader();
106
107 }
108
109 /**
110 * Register all of the hooks related to the public-facing functionality
111 * of the plugin.
112 *
113 * @since 1.0.0
114 * @access private
115 */
116 private function borderless_define_public_hooks() {
117
118 $plugin_public = new Borderless_Public( $this->get_plugin_name(), $this->get_version() );
119
120 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
121 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
122
123 }
124
125 /**
126 * Run the loader to execute all of the hooks with WordPress.
127 *
128 * @since 1.0.0
129 */
130 public function run() {
131 $this->loader->run();
132 }
133
134 /**
135 * The name of the plugin used to uniquely identify it within the context of
136 * WordPress and to define internationalization functionality.
137 *
138 * @since 1.0.0
139 * @return string The name of the plugin.
140 */
141 public function get_plugin_name() {
142 return $this->plugin_name;
143 }
144
145 /**
146 * The reference to the class that orchestrates the hooks with the plugin.
147 *
148 * @since 1.0.0
149 * @return Borderless_Loader Orchestrates the hooks of the plugin.
150 */
151 public function get_loader() {
152 return $this->loader;
153 }
154
155 /**
156 * Retrieve the version number of the plugin.
157 *
158 * @since 1.0.0
159 * @return string The version number of the plugin.
160 */
161 public function get_version() {
162 return $this->version;
163 }
164
165 }