PluginProbe
Borderless – Addons and Templates for Elementor / 1.2.5
Borderless – Addons and Templates for Elementor v1.2.5
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.2.5, at includes/class-borderless.php

170 lines 4.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 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 . "/widgets/contact-info.php" );
97 require_once( BORDERLESS__INC . "/widgets/divider.php" );
98 require_once( BORDERLESS__INC . "/widgets/search.php" );
99 require_once( BORDERLESS__INC . "/widgets/social-media.php" );
100 require_once( BORDERLESS__INC . "/widgets/spacer.php" );
101 require_once( BORDERLESS__INC . "/helper.php" );
102
103 if ( isset( $options['elementor'] ) ) {
104 require_once( BORDERLESS__ELEMENTOR . "/elementor.php" );
105 }
106 if ( isset( $options['related_posts'] ) ) {
107 require_once( BORDERLESS__RELATED_POSTS . "/related-posts.php" );
108 }
109
110 $this->loader = new Borderless_Loader();
111
112 }
113
114 /**
115 * Register all of the hooks related to the public-facing functionality
116 * of the plugin.
117 *
118 * @since 1.0.0
119 * @access private
120 */
121 private function borderless_define_public_hooks() {
122
123 $plugin_public = new Borderless_Public( $this->get_plugin_name(), $this->get_version() );
124
125 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
126 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
127
128 }
129
130 /**
131 * Run the loader to execute all of the hooks with WordPress.
132 *
133 * @since 1.0.0
134 */
135 public function run() {
136 $this->loader->run();
137 }
138
139 /**
140 * The name of the plugin used to uniquely identify it within the context of
141 * WordPress and to define internationalization functionality.
142 *
143 * @since 1.0.0
144 * @return string The name of the plugin.
145 */
146 public function get_plugin_name() {
147 return $this->plugin_name;
148 }
149
150 /**
151 * The reference to the class that orchestrates the hooks with the plugin.
152 *
153 * @since 1.0.0
154 * @return Borderless_Loader Orchestrates the hooks of the plugin.
155 */
156 public function get_loader() {
157 return $this->loader;
158 }
159
160 /**
161 * Retrieve the version number of the plugin.
162 *
163 * @since 1.0.0
164 * @return string The version number of the plugin.
165 */
166 public function get_version() {
167 return $this->version;
168 }
169
170 }