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

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