register_widget_type( new Blognest_Elementor_Widgets_Block_1() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Block_2() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Block_3() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Block_4() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Block_5() ); // 2. Grid Widgets. $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Grid_1() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Grid_2() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Grid_3() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Grid_4() ); $widgets_manager->register_widget_type( new Blognest_Elementor_Widgets_Grid_5() ); // 3. Global Widgets. $widgets_manager->register_widget_type( new Blognest_Elementor_Global_Widgets_Title() ); } endif; add_action( 'elementor/widgets/widgets_registered', 'blognest_elementor_widgets_registered' ); if ( ! function_exists( 'blognest_elementor_category' ) ) : /** * Add the Elementor category for use in Blognest widgets as separator. * * @since Blognest 1.0.0 */ function blognest_elementor_category() { // Register widget block category for Elementor section. \Elementor\Plugin::instance()->elements_manager->add_category( 'blognest-widget-blocks', array( 'title' => esc_html__( 'Blognest Widget Blocks', 'blognest' ), ), 1 ); // Register widget grid category for Elementor section. \Elementor\Plugin::instance()->elements_manager->add_category( 'blognest-widget-grid', array( 'title' => esc_html__( 'Blognest Widget Grid', 'blognest' ), ), 1 ); // Register widget global category for Elementor section. \Elementor\Plugin::instance()->elements_manager->add_category( 'blognest-widget-global', array( 'title' => esc_html__( 'Blognest Global Widgets', 'blognest' ), ), 1 ); } endif; add_action( 'elementor/init', 'blognest_elementor_category' ); if ( ! function_exists( 'blognest_elementor_enqueue_style' ) ) : /** * Enqueue the styles for use within Elementor only. * * @since Blognest 1.0.0 */ function blognest_elementor_enqueue_style() { $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; $file_name = is_rtl() ? 'elementor-rtl' . $suffix . '.css' : 'elementor' . $suffix . '.css'; wp_enqueue_style( 'blognest-elementor-style', get_template_directory_uri() . '/inc/compatibility/elementor/assets/css/' . $file_name, array(), BLOGNEST_VERSION ); } endif; add_action( 'elementor/frontend/after_enqueue_styles', 'blognest_elementor_enqueue_style' );