| @@ -1,49 +1,49 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Include & register widget. | |
| 4 | - * | |
| 5 | - * @package LearnPress/Widgets | |
| 6 | - * @author ThimPress <Nhamdv> | |
| 7 | - * @version 4.0.0 | |
| 8 | - */ | |
| 9 | - | |
| 10 | -defined( 'ABSPATH' ) || exit; | |
| 11 | - | |
| 12 | -require_once dirname( __FILE__ ) . '/Widgets/course-extra.php'; | |
| 13 | -require_once dirname( __FILE__ ) . '/Widgets/course-info.php'; | |
| 14 | -require_once dirname( __FILE__ ) . '/Widgets/course-progress.php'; | |
| 15 | -require_once dirname( __FILE__ ) . '/Widgets/featured-courses.php'; | |
| 16 | -require_once dirname( __FILE__ ) . '/Widgets/popular-courses.php'; | |
| 17 | -require_once dirname( __FILE__ ) . '/Widgets/recent-courses.php'; | |
| 18 | -require_once dirname( __FILE__ ) . '/Widgets/course-filter.php'; | |
| 19 | - | |
| 20 | -add_action( | |
| 21 | - 'widgets_init', | |
| 22 | - function() { | |
| 23 | - register_widget( 'LP_Widget_Course_Extra' ); | |
| 24 | - register_widget( 'LP_Widget_Course_Info' ); | |
| 25 | - register_widget( 'LP_Widget_Course_Progress' ); | |
| 26 | - register_widget( 'LP_Widget_Featured_Courses' ); | |
| 27 | - register_widget( 'LP_Widget_Popular_Courses' ); | |
| 28 | - register_widget( 'LP_Widget_Recent_Courses' ); | |
| 29 | - register_widget( 'LP_Widget_Course_Filter' ); | |
| 30 | - } | |
| 31 | -); | |
| 32 | - | |
| 33 | -add_action( | |
| 34 | - 'wp_enqueue_scripts', | |
| 35 | - function() { | |
| 36 | - if ( isset( $_GET['legacy-widget-preview'] ) ) { | |
| 37 | - wp_enqueue_style( 'learnpress-widgets-admin', LP_PLUGIN_URL . 'assets/css/widgets.css', array() ); | |
| 38 | - } | |
| 39 | - } | |
| 40 | -); | |
| 41 | - | |
| 42 | -add_action( | |
| 43 | - 'elementor/editor/before_enqueue_scripts', | |
| 44 | - function() { | |
| 45 | - wp_enqueue_script( 'learnpress-widgets-eleentor-select2', LP_PLUGIN_URL . 'assets/src/js/vendor/select2.full.min.js', array( 'jquery' ), false ); | |
| 46 | - wp_enqueue_script( 'learnpress-widgets-eleentor', LP_PLUGIN_URL . 'assets/js/dist/admin/pages/widgets.js', array( 'jquery' ), false ); | |
| 47 | - } | |
| 48 | -); | |
| 49 | - | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Include & register widget. | |
| 4 | + * | |
| 5 | + * @package LearnPress/Widgets | |
| 6 | + * @author ThimPress <Nhamdv> | |
| 7 | + * @version 4.0.0 | |
| 8 | + */ | |
| 9 | + | |
| 10 | +defined( 'ABSPATH' ) || exit; | |
| 11 | + | |
| 12 | +require_once dirname( __FILE__ ) . '/Widgets/course-extra.php'; | |
| 13 | +require_once dirname( __FILE__ ) . '/Widgets/course-info.php'; | |
| 14 | +require_once dirname( __FILE__ ) . '/Widgets/course-progress.php'; | |
| 15 | +require_once dirname( __FILE__ ) . '/Widgets/featured-courses.php'; | |
| 16 | +require_once dirname( __FILE__ ) . '/Widgets/popular-courses.php'; | |
| 17 | +require_once dirname( __FILE__ ) . '/Widgets/recent-courses.php'; | |
| 18 | +require_once dirname( __FILE__ ) . '/Widgets/course-filter.php'; | |
| 19 | + | |
| 20 | +add_action( | |
| 21 | + 'widgets_init', | |
| 22 | + function() { | |
| 23 | + register_widget( 'LP_Widget_Course_Extra' ); | |
| 24 | + register_widget( 'LP_Widget_Course_Info' ); | |
| 25 | + register_widget( 'LP_Widget_Course_Progress' ); | |
| 26 | + register_widget( 'LP_Widget_Featured_Courses' ); | |
| 27 | + register_widget( 'LP_Widget_Popular_Courses' ); | |
| 28 | + register_widget( 'LP_Widget_Recent_Courses' ); | |
| 29 | + register_widget( 'LP_Widget_Course_Filter' ); | |
| 30 | + } | |
| 31 | +); | |
| 32 | + | |
| 33 | +add_action( | |
| 34 | + 'wp_enqueue_scripts', | |
| 35 | + function() { | |
| 36 | + if ( isset( $_GET['legacy-widget-preview'] ) ) { | |
| 37 | + wp_enqueue_style( 'learnpress-widgets-admin', LP_PLUGIN_URL . 'assets/css/widgets.css', array() ); | |
| 38 | + } | |
| 39 | + } | |
| 40 | +); | |
| 41 | + | |
| 42 | +add_action( | |
| 43 | + 'elementor/editor/before_enqueue_scripts', | |
| 44 | + function() { | |
| 45 | + wp_enqueue_script( 'learnpress-widgets-eleentor-select2', LP_PLUGIN_URL . 'assets/src/js/vendor/select2.full.min.js', array( 'jquery' ), false ); | |
| 46 | + wp_enqueue_script( 'learnpress-widgets-eleentor', LP_PLUGIN_URL . 'assets/js/dist/admin/pages/widgets.js', array( 'jquery' ), false ); | |
| 47 | + } | |
| 48 | +); | |
| 49 | + | |