PluginProbe
Borderless – Addons and Templates for Elementor / 1.6.5
Borderless – Addons and Templates for Elementor v1.6.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 / borderless.php

borderless.php in Borderless – Addons and Templates for Elementor 1.6.5, at borderless.php

262 lines 7.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 Plugin Name: Borderless
5 Plugin URI: https://visualmodo.com/borderless/
6 Description: One service packed with powerful tools to help you reach your purposes.
7 Version: 1.6.5
8 Author: Visualmodo
9 Author URI: https://visualmodo.com
10 License: GPLv3 or later
11 Text Domain: borderless
12 Domain Path: /languages
13 */
14
15 // don't load directly
16 defined( 'ABSPATH' ) || exit;
17
18
19 /*-----------------------------------------------------------------------------------*/
20 /* *. Borderless Constants
21 /*-----------------------------------------------------------------------------------*/
22
23 define( 'BORDERLESS__VERSION', '1.6.5' );
24 define( 'BORDERLESS__DIR', plugin_dir_path( __FILE__ ) );
25 define( 'BORDERLESS__URL', plugins_url( '/', __FILE__ ) );
26 define( 'BORDERLESS__INC', BORDERLESS__DIR . '/includes' );
27 define( 'BORDERLESS__ASSETS', BORDERLESS__URL . 'assets/' );
28 define( 'BORDERLESS__STYLES', BORDERLESS__ASSETS . 'styles/' );
29 define( 'BORDERLESS__SCRIPTS', BORDERLESS__ASSETS . 'scripts/' );
30 define( 'BORDERLESS__LIB', BORDERLESS__ASSETS . 'lib/' );
31 define( 'BORDERLESS__LIBRARY__DIR', BORDERLESS__DIR . '/includes/library/' );
32 define( 'BORDERLESS__LIBRARY__URL', BORDERLESS__URL . 'includes/library/' );
33 define( 'BORDERLESS__BLOCK_EDITOR', BORDERLESS__DIR . '/modules/block-editor' );
34 define( 'BORDERLESS__ELEMENTOR', BORDERLESS__DIR . '/modules/elementor' );
35 define( 'BORDERLESS__WPBAKERY', BORDERLESS__DIR . '/modules/wpbakery' );
36 define( 'BORDERLESS__LIBS', BORDERLESS__DIR . '/modules/libraries' );
37 define( 'BORDERLESS__RELATED_POSTS', BORDERLESS__DIR . '/modules/related-posts' );
38
39 /*-----------------------------------------------------------------------------------*/
40 /* *. Borderless Core
41 /*-----------------------------------------------------------------------------------*/
42
43 class Borderless {
44
45 /**
46 * The loader that's responsible for maintaining and registering all hooks that power
47 * the plugin.
48 *
49 * @since 1.0.0
50 * @access protected
51 * @var Borderless_Loader $loader Maintains and registers all hooks for the plugin.
52 */
53 protected $loader;
54
55 /**
56 * The unique identifier of this plugin.
57 *
58 * @since 1.0.0
59 * @access protected
60 * @var string $plugin_name The string used to uniquely identify this plugin.
61 */
62 protected $plugin_name;
63
64 /**
65 * The current version of the plugin.
66 *
67 * @since 1.0.0
68 * @access protected
69 * @var string $version The current version of the plugin.
70 */
71 protected $version;
72
73 /**
74 * Define the core functionality of the plugin.
75 *
76 * Set the plugin name and the plugin version that can be used throughout the plugin.
77 * Load the dependencies, define the locale, and set the hooks for the admin area and
78 * the public-facing side of the site.
79 *
80 * @since 1.0.0
81 */
82 public function __construct() {
83
84 if ( defined( 'BORDERLESS__VERSION' ) ) {
85 $this->version = BORDERLESS__VERSION;
86 } else {
87 $this->version = '1.0.0';
88 }
89 $this->plugin_name = 'borderless';
90
91 $this->borderless_load_dependencies();
92 $this->borderless_define_public_hooks();
93
94 }
95
96 /**
97 * Define the core functionality of the plugin.
98 *
99 * Set the plugin name and the plugin version that can be used throughout the plugin.
100 * Load the dependencies, define the locale, and set the hooks for the admin area and
101 * the public-facing side of the site.
102 *
103 * @since 1.0.0
104 */
105
106 public function borderless_load_dependencies() {
107
108 $options = get_option( 'borderless' );
109
110 $theme = wp_get_theme(get_template());
111
112 /**
113 * Dashboard Page.
114 */
115
116 require_once( BORDERLESS__INC . "/templates/dashboard.php" );
117
118 /**
119 * License Manager Page.
120 */
121
122 require_once( BORDERLESS__INC . "/templates/license.php" );
123
124 /**
125 * The class responsible for orchestrating the actions and filters of the
126 * core plugin.
127 */
128 require_once( BORDERLESS__INC . "/class-borderless-loader.php" );
129
130 /**
131 * The class responsible for defining all actions that occur in the public-facing
132 * side of the site.
133 */
134 require_once( BORDERLESS__INC . "/class-borderless-public.php" );
135
136 require_once( BORDERLESS__INC . "/templates/system-info.php" );
137 require_once( BORDERLESS__INC . "/icon-manager/icon-manager.php" );
138 require_once( BORDERLESS__INC . "/custom-post-types/custom-post-types.php" );
139 require_once( BORDERLESS__BLOCK_EDITOR . "/contact-information/contact-information.php" );
140 require_once( BORDERLESS__BLOCK_EDITOR . "/social-icons/social-icons.php" );
141 require_once( BORDERLESS__BLOCK_EDITOR . "/spacer/spacer.php" );
142 require_once( BORDERLESS__ELEMENTOR . "/elementor.php" );
143 require_once( BORDERLESS__WPBAKERY . "/wpbakery.php" );
144 require_once( BORDERLESS__INC . "/helper.php" );
145 require_once( BORDERLESS__INC . "/custom-post-types/templates.php" );
146 require_once( BORDERLESS__LIBRARY__DIR . "templates/templates.php" );
147 require_once( BORDERLESS__LIBRARY__DIR . "importer.php" );
148
149 if ( isset( $options['related_posts'] ) ) {
150 require_once( BORDERLESS__RELATED_POSTS . "/related-posts.php" );
151 }
152
153 $this->loader = new Borderless_Loader();
154
155 }
156
157 /**
158 * Register all of the hooks related to the public-facing functionality
159 * of the plugin.
160 *
161 * @since 1.0.0
162 * @access private
163 */
164 private function borderless_define_public_hooks() {
165
166 $plugin_public = new Borderless_Public( $this->get_plugin_name(), $this->get_version() );
167
168 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
169 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
170
171 // Enqueue script for Gutenberg
172 add_action('enqueue_block_editor_assets', array($this, 'enqueue_gutenberg_button_script'));
173
174
175 function borderless_settings_colors() {
176 $options = get_option( 'borderless' );
177
178 ?>
179 <style type="text/css">
180
181 :root {
182 --borderless-color-primary: <?php echo esc_attr( $options['primary_color'], '#0000FF' ); ?>;
183 --borderless-secondary-primary: <?php echo esc_attr( $options['secondary_color'], '#FF6819' ); ?>;
184 --borderless-color-tertiary: <?php echo esc_attr( $options['tertiary_color'], '#3FCC14' ); ?>;
185 }
186
187 </style>
188 <?php
189
190 }
191 add_action( 'wp_head', 'borderless_settings_colors' );
192
193 }
194
195 /**
196 * Enqueue the script for the Gutenberg editor.
197 *
198 * @since 1.0.0
199 */
200 public function enqueue_gutenberg_button_script() {
201 wp_enqueue_script(
202 'borderless-ai-button',
203 BORDERLESS__SCRIPTS . 'ai-button.js',
204 array( 'wp-element', 'wp-components', 'wp-edit-post', 'wp-plugins' ), // Added 'wp-plugins' dependency
205 filemtime( BORDERLESS__DIR . 'assets/scripts/ai-button.js' ),
206 true
207 );
208 }
209
210 /**
211 * Run the loader to execute all of the hooks with WordPress.
212 *
213 * @since 1.0.0
214 */
215 public function run() {
216 $this->loader->run();
217 }
218
219 /**
220 * The name of the plugin used to uniquely identify it within the context of
221 * WordPress and to define internationalization functionality.
222 *
223 * @since 1.0.0
224 * @return string The name of the plugin.
225 */
226 public function get_plugin_name() {
227 return $this->plugin_name;
228 }
229
230 /**
231 * The reference to the class that orchestrates the hooks with the plugin.
232 *
233 * @since 1.0.0
234 * @return Borderless_Loader Orchestrates the hooks of the plugin.
235 */
236 public function get_loader() {
237 return $this->loader;
238 }
239
240 /**
241 * Retrieve the version number of the plugin.
242 *
243 * @since 1.0.0
244 * @return string The version number of the plugin.
245 */
246 public function get_version() {
247 return $this->version;
248 }
249
250 }
251
252 /*-----------------------------------------------------------------------------------*/
253 /* *. Borderless Init
254 /*-----------------------------------------------------------------------------------*/
255
256 function run_borderless() {
257
258 $plugin = new Borderless();
259 $plugin->run();
260
261 }
262 run_borderless();