elementskit-lite
Last commit date
compatibility
2 years ago
config
2 years ago
core
3 years ago
helpers
2 years ago
languages
2 years ago
libs
2 years ago
modules
2 years ago
traits
4 years ago
widgets
2 years ago
autoloader.php
4 years ago
elementskit-lite.php
2 years ago
plugin.php
2 years ago
readme.txt
2 years ago
wpml-config.xml
3 years ago
plugin.php
463 lines
| 1 | <?php |
| 2 | namespace ElementsKit_Lite; |
| 3 | |
| 4 | defined( 'ABSPATH' ) || exit; |
| 5 | |
| 6 | |
| 7 | /** |
| 8 | * ElementsKit - the God class. |
| 9 | * Initiate all necessary classes, hooks, configs. |
| 10 | * |
| 11 | * @since 1.0.0 |
| 12 | */ |
| 13 | class Plugin { |
| 14 | |
| 15 | |
| 16 | /** |
| 17 | * The plugin instance. |
| 18 | * |
| 19 | * @since 1.0.0 |
| 20 | * @access public |
| 21 | * @static |
| 22 | * |
| 23 | * @var Plugin |
| 24 | */ |
| 25 | public static $instance = null; |
| 26 | |
| 27 | /** |
| 28 | * Construct the plugin object. |
| 29 | * |
| 30 | * @since 1.0.0 |
| 31 | * @access public |
| 32 | */ |
| 33 | public function __construct() { |
| 34 | |
| 35 | // check on-boarding status |
| 36 | Libs\Framework\Classes\Onboard_Status::instance()->onboard(); |
| 37 | |
| 38 | // Enqueue frontend scripts. |
| 39 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend' ) ); |
| 40 | |
| 41 | // migrate old settings db to new format |
| 42 | new Compatibility\Data_Migration\Settings_Db(); |
| 43 | |
| 44 | // Enqueue admin scripts. |
| 45 | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin' ) ); |
| 46 | |
| 47 | // Enqueue inline scripts |
| 48 | Core\Build_Inline_Scripts::instance(); |
| 49 | |
| 50 | // Register plugin settings pages |
| 51 | Libs\Framework\Attr::instance(); |
| 52 | |
| 53 | // Register default widgets |
| 54 | Core\Build_Widgets::instance(); |
| 55 | |
| 56 | // Register default modules |
| 57 | Core\Build_Modules::instance(); |
| 58 | |
| 59 | // register plugin activation actions |
| 60 | ( new Core\Activation_Actions() )->init(); |
| 61 | |
| 62 | add_action( 'wp_head', array( $this, 'add_meta_for_search_excluded' ) ); |
| 63 | |
| 64 | // Register ElementsKit supported widgets to Elementor from 3rd party plugins. |
| 65 | add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ), 1050 ); |
| 66 | |
| 67 | // Register wpml compatibility |
| 68 | Compatibility\Wpml\Init::instance(); |
| 69 | |
| 70 | // Compatibility issues |
| 71 | Compatibility\Conflicts\Init::instance(); |
| 72 | |
| 73 | // Show forms sub menu page |
| 74 | \Wpmet\Libs\Forms::instance(); |
| 75 | |
| 76 | $is_pro_active = in_array( 'elementskit/elementskit.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ); |
| 77 | |
| 78 | if ( is_admin() && Libs\Framework\Classes\Utils::instance()->get_settings( 'ekit_user_consent_for_banner', 'yes' ) == 'yes' ) { |
| 79 | $filter_string = \ElementsKit_Lite::active_plugins(); |
| 80 | /** |
| 81 | * Show WPMET stories widget in dashboard |
| 82 | */ |
| 83 | \Wpmet\Libs\Stories::instance( 'elementskit-lite' ) |
| 84 | // ->is_test(true) |
| 85 | ->set_filter( $filter_string ) |
| 86 | ->set_plugin( 'ElementsKit', 'https://wpmet.com/plugin/elementskit/' ) |
| 87 | ->set_api_url( 'https://api.wpmet.com/public/stories/' ) |
| 88 | ->call(); |
| 89 | |
| 90 | /** |
| 91 | * Show WPMET banner (codename: jhanda) |
| 92 | */ |
| 93 | \Wpmet\Libs\Banner::instance( 'elementskit-lite' ) |
| 94 | // ->is_test(true) |
| 95 | ->set_filter( ltrim( $filter_string, ',' ) ) |
| 96 | ->set_api_url( 'https://api.wpmet.com/public/jhanda' ) |
| 97 | ->set_plugin_screens( 'edit-elementskit_template' ) |
| 98 | ->set_plugin_screens( 'toplevel_page_elementskit' ) |
| 99 | ->call(); |
| 100 | |
| 101 | /** |
| 102 | * Ask for rating |
| 103 | * A rating notice will appear depends on |
| 104 | * @set_first_appear_day methods |
| 105 | */ |
| 106 | \Wpmet\Libs\Rating::instance( 'elementskit-lite' ) |
| 107 | ->set_plugin( 'ElementsKit', 'https://wpmet.com/wordpress.org/rating/elementskit' ) |
| 108 | ->set_plugin_logo( 'https://ps.w.org/elementskit-lite/assets/icon-128x128.gif', 'width:150px !important' ) |
| 109 | ->set_allowed_screens( 'edit-elementskit_template' ) |
| 110 | ->set_allowed_screens( 'toplevel_page_elementskit' ) |
| 111 | ->set_allowed_screens( 'elementskit_page_elementskit-lite_get_help' ) |
| 112 | ->set_priority( 10 ) |
| 113 | ->set_first_appear_day( 7 ) |
| 114 | ->set_condition( true ) |
| 115 | ->call(); |
| 116 | |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Show go Premium menu |
| 121 | */ |
| 122 | $pro_awareness = \Wpmet\Libs\Pro_Awareness::instance('elementskit-lite'); |
| 123 | |
| 124 | if(version_compare($pro_awareness->get_version(), '1.2.0') >= 0) { |
| 125 | $pro_awareness |
| 126 | ->set_parent_menu_slug( 'elementskit' ) |
| 127 | ->set_plugin_file( 'elementskit-lite/elementskit-lite.php' ) |
| 128 | ->set_pro_link( |
| 129 | ( ( \ElementsKit_Lite::package_type() != 'free' ) ? '' : 'https://wpmet.com/elementskit-pricing' ) |
| 130 | ) |
| 131 | ->set_default_grid_thumbnail( \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/support.png' ) |
| 132 | ->set_page_grid( |
| 133 | array( |
| 134 | 'url' => 'https://wpmet.com/fb-group', |
| 135 | 'title' => 'Join the Community', |
| 136 | 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/community.png', |
| 137 | 'description' => 'Join our Facebook group to get 20% discount coupon on premium products. Follow us to get more exciting offers.' |
| 138 | ) |
| 139 | ) |
| 140 | ->set_page_grid( |
| 141 | array( |
| 142 | 'url' => 'https://www.youtube.com/playlist?list=PL3t2OjZ6gY8MVnyA4OLB6qXb77-roJOuY', |
| 143 | 'title' => 'Video Tutorials', |
| 144 | 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/videos.png', |
| 145 | 'description' => 'Learn the step by step process for developing your site easily from video tutorials.' |
| 146 | ) |
| 147 | ) |
| 148 | ->set_page_grid( |
| 149 | array( |
| 150 | 'url' => 'https://wpmet.com/plugin/elementskit/roadmaps#ideas', |
| 151 | 'title' => 'Request a feature', |
| 152 | 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/request.png', |
| 153 | 'description' => 'Have any special feature in mind? Let us know through the feature request.' |
| 154 | ) |
| 155 | ) |
| 156 | ->set_page_grid( |
| 157 | array( |
| 158 | 'url' => 'https://wpmet.com/doc/elementskit/', |
| 159 | 'title' => 'Documentation', |
| 160 | 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/documentation.png', |
| 161 | 'description' => 'Detailed documentation to help you understand the functionality of each feature.' |
| 162 | ) |
| 163 | ) |
| 164 | ->set_page_grid( |
| 165 | array( |
| 166 | 'url' => 'https://wpmet.com/plugin/elementskit/roadmaps/', |
| 167 | 'title' => 'Public Roadmap', |
| 168 | 'thumbnail' => \ElementsKit_Lite::lib_url() . 'pro-awareness/assets/roadmaps.png', |
| 169 | 'description' => 'Check our upcoming new features, detailed development stories and tasks' |
| 170 | ) |
| 171 | ) |
| 172 | ->set_plugin_row_meta( 'Documentation', 'https://wpmet.com/elementskit-docs', array( 'target' => '_blank' ) ) |
| 173 | ->set_plugin_row_meta( 'Facebook Community', 'https://wpmet.com/fb-group', array( 'target' => '_blank' ) ) |
| 174 | ->set_plugin_row_meta( 'Rate the plugin � |
| 175 | � |
| 176 | � |
| 177 | � |
| 178 | � |
| 179 | ', 'https://wordpress.org/support/plugin/elementskit-lite/reviews/#new-post', array( 'target' => '_blank' ) ) |
| 180 | ->set_plugin_action_link( 'Settings', admin_url() . 'admin.php?page=elementskit' ) |
| 181 | ->set_plugin_action_link( |
| 182 | ( $is_pro_active ? '' : 'Go Premium' ), |
| 183 | 'https://wpmet.com/plugin/elementskit', |
| 184 | array( |
| 185 | 'target' => '_blank', |
| 186 | 'style' => 'color: #FCB214; font-weight: bold;', |
| 187 | ) |
| 188 | ) |
| 189 | ->call(); |
| 190 | } |
| 191 | |
| 192 | // Adding pro lebel |
| 193 | if ( \ElementsKit_Lite::package_type() == 'free' ) { |
| 194 | new Libs\Pro_Label\Init(); |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Show our plugins menu for others wpmet plugins |
| 199 | */ |
| 200 | \Wpmet\Libs\Our_Plugins::instance()->init('elementskit-lite') # @text_domain |
| 201 | ->set_parent_menu_slug('elementskit') # @plugin_slug |
| 202 | ->set_submenu_name( |
| 203 | esc_html__('Our Plugins', 'elementskit-lite') |
| 204 | ) # @submenu_name (optional- default: Our Plugins) |
| 205 | ->set_section_title( |
| 206 | esc_html__('Take Your WordPress Website To Next Level!', 'elementskit-lite') |
| 207 | ) # @section_title (optional) |
| 208 | ->set_section_description( |
| 209 | esc_html__('Our diverse range of plugins has every solution for WordPress, Gutenberg, Elementor, and WooCommerce.', 'elementskit-lite') |
| 210 | ) # @section_description (optional) |
| 211 | ->set_items_per_row(4) # @items_per_row (optional- default: 6) |
| 212 | ->set_plugins( |
| 213 | [ |
| 214 | 'getgenie/getgenie.php' => [ |
| 215 | 'name' => esc_html__('GetGenie AI', 'elementskit-lite'), |
| 216 | 'url' => 'https://wordpress.org/plugins/getgenie/', |
| 217 | 'icon' => 'https://ps.w.org/getgenie/assets/icon-256x256.gif?rev=2798355', |
| 218 | 'desc' => esc_html__('Your personal AI assistant for content and SEO. Write content that ranks on Google with NLP keywords and SERP analysis data.', 'elementskit-lite'), |
| 219 | 'docs' => 'https://getgenie.ai/docs/', |
| 220 | ], |
| 221 | 'gutenkit-blocks-addon/gutenkit-blocks-addon.php' => [ |
| 222 | 'name' => esc_html__('GutenKit', 'elementskit-lite'), |
| 223 | 'url' => 'https://wordpress.org/plugins/gutenkit-blocks-addon/', |
| 224 | 'icon' => 'https://ps.w.org/gutenkit-blocks-addon/assets/icon-256x256.png?rev=3044956', |
| 225 | 'desc' => esc_html__('Gutenberg blocks, patterns, and templates that extend the page-building experience using the WordPress block editor.', 'elementskit-lite'), |
| 226 | 'docs' => 'https://wpmet.com/docs/gutenkit/', |
| 227 | ], |
| 228 | 'shopengine/shopengine.php' => [ |
| 229 | 'name' => esc_html__('ShopEngine', 'elementskit-lite'), |
| 230 | 'url' => 'https://wordpress.org/plugins/shopengine/', |
| 231 | 'icon' => 'https://ps.w.org/shopengine/assets/icon-256x256.gif?rev=2505061', |
| 232 | 'desc' => esc_html__('Complete WooCommerce solution for Elementor to fully customize any pages including cart, checkout, shop page, and so on.', 'elementskit-lite'), |
| 233 | 'docs' => 'https://wpmet.com/doc/shopengine/', |
| 234 | ], |
| 235 | 'metform/metform.php' => [ |
| 236 | 'name' => esc_html__('MetForm', 'elementskit-lite'), |
| 237 | 'url' => 'https://wordpress.org/plugins/genie-image-ai/', |
| 238 | 'icon' => 'https://ps.w.org/metform/assets/icon-256x256.png?rev=2544152', |
| 239 | 'desc' => esc_html__('Drag & drop form builder for Elementor to create contact forms, multi-step forms, and more — smoother, faster, and better!', 'elementskit-lite'), |
| 240 | 'docs' => 'https://wpmet.com/doc/metform/', |
| 241 | ], |
| 242 | 'emailkit/EmailKit.php' => [ |
| 243 | 'name' => esc_html__('EmailKit', 'elementskit-lite'), |
| 244 | 'url' => 'https://wordpress.org/plugins/genie-image-ai/', |
| 245 | 'icon' => 'https://ps.w.org/emailkit/assets/icon-256x256.png?rev=3003571', |
| 246 | 'desc' => esc_html__('Advanced email customizer for WooCommerce and WordPress. Build, customize, and send emails from WordPress to boost your sales!', 'elementskit-lite'), |
| 247 | 'docs' => 'https://wpmet.com/doc/emailkit/', |
| 248 | ], |
| 249 | 'wp-social/wp-social.php' => [ |
| 250 | 'name' => esc_html__('WP Social', 'elementskit-lite'), |
| 251 | 'url' => 'https://wordpress.org/plugins/wp-social/', |
| 252 | 'icon' => 'https://ps.w.org/wp-social/assets/icon-256x256.png?rev=2544214', |
| 253 | 'desc' => esc_html__('Add social share, login, and engagement counter — unified solution for all social media with tons of different styles for your website.', 'elementskit-lite'), |
| 254 | 'docs' => 'https://wpmet.com/doc/wp-social/', |
| 255 | ], |
| 256 | 'wp-ultimate-review/wp-ultimate-review.php' => [ |
| 257 | 'name' => esc_html__('WP Ultimate Review', 'elementskit-lite'), |
| 258 | 'url' => 'https://wordpress.org/plugins/wp-ultimate-review/', |
| 259 | 'icon' => 'https://ps.w.org/wp-ultimate-review/assets/icon-256x256.png?rev=2544187', |
| 260 | 'desc' => esc_html__('Collect and showcase reviews on your website to build brand credibility and social proof with the easiest solution.', 'elementskit-lite'), |
| 261 | 'docs' => 'https://wpmet.com/doc/wp-ultimate-review/', |
| 262 | ], |
| 263 | 'wp-fundraising-donation/wp-fundraising.php' => [ |
| 264 | 'name' => esc_html__('FundEngine', 'elementskit-lite'), |
| 265 | 'url' => 'https://wordpress.org/plugins/wp-fundraising-donation/', |
| 266 | 'icon' => 'https://ps.w.org/wp-fundraising-donation/assets/icon-256x256.png?rev=2544150', |
| 267 | 'desc' => esc_html__('Create fundraising, crowdfunding, and donation websites with PayPal and Stripe payment gateway integration.', 'elementskit-lite'), |
| 268 | 'docs' => 'https://wpmet.com/doc/fundengine/', |
| 269 | ], |
| 270 | 'blocks-for-shopengine/shopengine-gutenberg-addon.php' => [ |
| 271 | 'name' => esc_html__('Blocks for ShopEngine', 'elementskit-lite'), |
| 272 | 'url' => 'https://wordpress.org/plugins/blocks-for-shopengine/', |
| 273 | 'icon' => 'https://ps.w.org/blocks-for-shopengine/assets/icon-256x256.gif?rev=2702483', |
| 274 | 'desc' => esc_html__('All in one WooCommerce solution for Gutenberg! Build your WooCommerce pages in a block editor with full customization.', 'elementskit-lite'), |
| 275 | 'docs' => 'https://wpmet.com/doc/shopengine/shopengine-gutenberg/', |
| 276 | ], |
| 277 | 'genie-image-ai/genie-image-ai.php' => [ |
| 278 | 'name' => esc_html__('Genie Image', 'elementskit-lite'), |
| 279 | 'url' => 'https://wordpress.org/plugins/genie-image-ai/', |
| 280 | 'icon' => 'https://ps.w.org/genie-image-ai/assets/icon-256x256.png?rev=2977297', |
| 281 | 'desc' => esc_html__('AI-powered text-to-image generator for WordPress with OpenAI’s DALL-E 2 technology to generate high-quality images in one click.', 'elementskit-lite'), |
| 282 | 'docs' => 'https://getgenie.ai/docs/', |
| 283 | ], |
| 284 | ] |
| 285 | ) # @plugins |
| 286 | ->call(); |
| 287 | |
| 288 | /** |
| 289 | * EmailKit Global Class initialization |
| 290 | * |
| 291 | */ |
| 292 | if( !did_action('edit_with_emailkit_loaded') && class_exists('\Wpmet\Libs\Emailkit') ) { |
| 293 | new \Wpmet\Libs\Emailkit(); |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * Check the admin screen and show the rating notice if eligible |
| 299 | * |
| 300 | * @access private |
| 301 | * @return boolean |
| 302 | */ |
| 303 | private function should_show_rating_notice() { |
| 304 | |
| 305 | if ( \ElementsKit_Lite::package_type() == 'free' ) { |
| 306 | return true; |
| 307 | } |
| 308 | |
| 309 | if ( ! function_exists( 'get_current_screen' ) ) { |
| 310 | return false; |
| 311 | } |
| 312 | |
| 313 | $current_screen = ( get_current_screen() )->base; |
| 314 | $current_post_type = ( get_current_screen() )->post_type; |
| 315 | $eligible_post_type = array( 'elementskit_template' ); |
| 316 | $eligible_screens = array( 'plugins', 'dashboard', 'elementskit', 'themes' ); |
| 317 | |
| 318 | if ( in_array( $current_post_type, $eligible_post_type ) ) { |
| 319 | return true; |
| 320 | } |
| 321 | |
| 322 | if ( in_array( $current_screen, $eligible_screens ) ) { |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | return false; |
| 327 | } |
| 328 | |
| 329 | /** |
| 330 | * Enqueue scripts |
| 331 | * |
| 332 | * Enqueue js and css to frontend. |
| 333 | * |
| 334 | * @since 1.0.0 |
| 335 | * @access public |
| 336 | */ |
| 337 | public function enqueue_frontend() { |
| 338 | wp_enqueue_script( 'elementskit-framework-js-frontend', \ElementsKit_Lite::lib_url() . 'framework/assets/js/frontend-script.js', array( 'jquery' ), \ElementsKit_Lite::version(), true ); |
| 339 | } |
| 340 | |
| 341 | /** |
| 342 | * Enqueue scripts |
| 343 | * |
| 344 | * Enqueue js and css to admin. |
| 345 | * |
| 346 | * @since 1.0.0 |
| 347 | * @access public |
| 348 | */ |
| 349 | public function enqueue_admin() { |
| 350 | $screen = get_current_screen(); |
| 351 | |
| 352 | if ( ! in_array( $screen->id, array( 'nav-menus', 'toplevel_page_elementskit', 'edit-elementskit_template', 'elementskit_page_elementskit-license', 'elementskit_page_elementskit-lite_get_help' ) ) ) { |
| 353 | return; |
| 354 | } |
| 355 | |
| 356 | wp_register_style( 'fontawesome', \ElementsKit_Lite::widget_url() . 'init/assets/css/font-awesome.min.css', false, \ElementsKit_Lite::version() ); |
| 357 | wp_register_style( 'elementskit-font-css-admin', \ElementsKit_Lite::module_url() . 'elementskit-icon-pack/assets/css/ekiticons.css', false, \ElementsKit_Lite::version() ); |
| 358 | wp_register_style( 'elementskit-init-css-admin', \ElementsKit_Lite::lib_url() . 'framework/assets/css/admin-style.css', false, \ElementsKit_Lite::version() ); |
| 359 | |
| 360 | wp_enqueue_style( 'fontawesome' ); |
| 361 | wp_enqueue_style( 'elementskit-font-css-admin' ); |
| 362 | wp_enqueue_style( 'elementskit-init-css-admin' ); |
| 363 | |
| 364 | wp_enqueue_script( 'ekit-admin-core', \ElementsKit_Lite::lib_url() . 'framework/assets/js/ekit-admin-core.js', array( 'jquery' ), \ElementsKit_Lite::version(), true ); |
| 365 | |
| 366 | $data['rest_url'] = get_rest_url(); |
| 367 | $data['nonce'] = wp_create_nonce( 'wp_rest' ); |
| 368 | |
| 369 | wp_localize_script( 'ekit-admin-core', 'rest_config', $data ); |
| 370 | |
| 371 | wp_localize_script( |
| 372 | 'ekit-admin-core', |
| 373 | 'ekit_ajax_var', |
| 374 | array( |
| 375 | 'nonce' => wp_create_nonce( 'ajax-nonce' ), |
| 376 | ) |
| 377 | ); |
| 378 | } |
| 379 | |
| 380 | /** |
| 381 | * Control registrar. |
| 382 | * |
| 383 | * Register the custom controls for Elementor |
| 384 | * using `elementskit/widgets/widgets_registered` action. |
| 385 | * |
| 386 | * @since 1.0.0 |
| 387 | * @access public |
| 388 | */ |
| 389 | public function register_control( $widgets_manager ) { |
| 390 | do_action( 'elementskit/widgets/widgets_registered', $widgets_manager ); |
| 391 | } |
| 392 | |
| 393 | |
| 394 | /** |
| 395 | * Widget registrar. |
| 396 | * |
| 397 | * Retrieve all the registered widgets |
| 398 | * using `elementor/widgets/register` action. |
| 399 | * |
| 400 | * @since 1.0.0 |
| 401 | * @access public |
| 402 | */ |
| 403 | public function register_widgets( $widgets_manager ) { |
| 404 | do_action( 'elementskit/widgets/widgets_registered', $widgets_manager ); |
| 405 | } |
| 406 | |
| 407 | /** |
| 408 | * Excluding ElementsKit template and megamenu content from search engine. |
| 409 | * See - https://wordpress.org/support/topic/google-is-indexing-elementskit-content-as-separate-pages/ |
| 410 | * |
| 411 | * @since 1.4.5 |
| 412 | * @access public |
| 413 | */ |
| 414 | public function add_meta_for_search_excluded() { |
| 415 | if ( in_array( |
| 416 | get_post_type(), |
| 417 | array( 'elementskit_widget', 'elementskit_template', 'elementskit_content' ) |
| 418 | ) |
| 419 | ) { |
| 420 | echo '<meta name="robots" content="noindex,nofollow" />', "\n"; |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | /** |
| 425 | * Autoloader. |
| 426 | * |
| 427 | * ElementsKit autoloader loads all the classes needed to run the plugin. |
| 428 | * |
| 429 | * @since 1.0.0 |
| 430 | * @access private |
| 431 | */ |
| 432 | public static function registrar_autoloader() { |
| 433 | require_once \ElementsKit_Lite::plugin_dir() . '/autoloader.php'; |
| 434 | Autoloader::run(); |
| 435 | } |
| 436 | |
| 437 | /** |
| 438 | * Instance. |
| 439 | * |
| 440 | * Ensures only one instance of the plugin class is loaded or can be loaded. |
| 441 | * |
| 442 | * @since 1.0.0 |
| 443 | * @access public |
| 444 | * @static |
| 445 | * |
| 446 | * @return Plugin An instance of the class. |
| 447 | */ |
| 448 | public static function instance() { |
| 449 | if ( is_null( self::$instance ) ) { |
| 450 | |
| 451 | do_action( 'elementskit_lite/before_loaded' ); |
| 452 | |
| 453 | // Fire when ElementsKit instance. |
| 454 | self::$instance = new self(); |
| 455 | |
| 456 | do_action( 'elementskit/loaded' ); // legacy support |
| 457 | do_action( 'elementskit_lite/after_loaded' ); |
| 458 | } |
| 459 | |
| 460 | return self::$instance; |
| 461 | } |
| 462 | } |
| 463 |