'AddonCraft', 'icon' => 'fa fa-plug', ]; $old_categories = $elements_manager->get_categories(); $categories = array_merge( array_slice($old_categories, 0, 4), $categories, array_slice($old_categories, 4, null), ); $set_categories = function ( $categories ) { $this->categories = $categories; }; $set_categories->call( $elements_manager, $categories ); } /** * Register widgets * * @since v1.0.0 */ public function register_new_widgets() { require_once 'elementor/element/marquee.php'; \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ACE_Marquee ); if ( class_exists( 'WooCommerce' ) ) { require_once 'elementor/element/product-slider.php'; \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ACE_Product_Slider ); } require_once 'elementor/element/before-after-image-comparison.php'; \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new BeforeAfterImageComparison ); require_once 'elementor/element/logo-infinite-carousel.php'; \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ACE_Logo_Infinite_Carousel ); require_once 'elementor/element/products-slider.php'; \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ACE_Products_Slider ); } /** * Check if a plugin is installed * * @since v1.0.0 */ public function is_plugin_installed( $basename ) { if (!function_exists('get_plugins')) { include_once ABSPATH . '/wp-admin/includes/plugin.php'; } $installed_plugins = get_plugins(); return isset( $installed_plugins[ $basename ] ); } /** * Output a admin notice when build dependencies not met. * * @return void */ public function build_dependencies_notice() { if (!current_user_can('activate_plugins')) { return; } if ( ! did_action( 'elementor/loaded' ) && is_admin() ) { $elementor = 'elementor/elementor.php'; if ($this->is_plugin_installed($elementor)) { $activation_url = wp_nonce_url('plugins.php?action=activate&plugin=' . $elementor . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $elementor); /* translators: %s AddonCraft for Elementor %s requires %s Elementor %s plugin to be active. Please activate Elementor to continue. */ $message = sprintf(__('%1$sAddonCraft for Elementor%2$s requires %1$sElementor%2$s plugin to be active. Please activate Elementor to continue.', 'addoncraft-for-elementor'), "", ""); $button_text = __('Activate Elementor', 'addoncraft-for-elementor'); } else { $activation_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=elementor'), 'install-plugin_elementor'); /* translators: %s AddonCraft for Elementor %s requires %s Elementor %s plugin to be installed and activated. Please install Elementor to continue. */ $message = sprintf(__('%1$sAddonCraft for Elementor%2$s requires %1$sElementor%2$s plugin to be installed and activated. Please install Elementor to continue.', 'addoncraft-for-elementor'), '', ''); $button_text = __('Install Elementor', 'addoncraft-for-elementor'); } $button = '

' . esc_html( $button_text ) . '

'; printf( '

%1$s

%2$s
', wp_kses_post($message), wp_kses_post($button) ); } } } // Load the plugin add_action( 'plugins_loaded', function(){ ACE_ELEMENTOR_ADDON::get_instance(); }, 99);