PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | inc/admin/class-lp-admin.php +28 -15 4.4.3 → 4.4.9 View file →
@@ -5,9 +5,12 @@
5 5 * @version 1.0.2
6 6 */
7 7
8 8 use LearnPress\Background\LPBackgroundAjax;
9 +use LearnPress\Helpers\Template;
9 10 use LearnPress\Models\CourseModel;
11 +use LearnPress\TemplateHooks\Admin\Notices\AdminNotesTemplate;
12 +use LearnPress\TemplateHooks\TemplateAJAX;
10 13 use LearnPress\TemplateHooks\CourseBuilder\Course\BuilderCourseTemplate;
11 14
12 15 defined( 'ABSPATH' ) || exit;
13 16
@@ -34,9 +37,9 @@
34 37 ];
35 38 $this->includes();
36 39 add_action( 'delete_user', array( $this, 'delete_user_data' ) );
37 40 //add_action( 'delete_user_form', array( $this, 'delete_user_form' ) );
38 - add_action( 'all_admin_notices', array( $this, 'admin_notices' ), - 1 );
41 + add_action( 'admin_footer', array( $this, 'admin_notices' ) );
39 42 add_action( 'admin_enqueue_scripts', array( $this, 'load_modal' ) );
40 43 add_filter( 'admin_body_class', array( $this, 'body_class' ) );
41 44 //add_filter( 'manage_users_custom_column', array( $this, 'users_custom_column' ), 10, 3 );
42 45 //add_filter( 'manage_pages_columns', array( $this, 'page_columns_head' ) );
@@ -655,17 +658,8 @@
655 658 return;
656 659 }
657 660 }
658 661
659 - // Show template file templates override.
660 - $page = LP_Request::get_param( 'page' );
661 - $tab = LP_Request::get_param( 'tab' );
662 - if ( $page == 'learn-press-tools' && $tab == 'templates' ) {
663 - if ( LP_Outdated_Template_Helper::detect_outdated_template() ) {
664 - learn_press_admin_view( 'html-admin-notice-templates' );
665 - }
666 - }
667 -
668 662 // Request accept/denied user can become a teacher.
669 663 $action_become_teacher = LP_Request::get_param( 'lp-action' );
670 664 $user_id = LP_Request::get_param( 'user_id', 0, 'int' );
671 665 $type_action_become_teacher = array( 'accepted-request', 'denied-request' );
@@ -683,9 +677,30 @@
683 677 </div>
684 678 <?php
685 679 }
686 680
687 - learn_press_admin_view( 'admin-notices.php', [], true );
681 + // Load Ajax notes here
682 + /** @use AdminNotesTemplate::render_notices */
683 + $html_notices = TemplateAJAX::load_content_via_ajax(
684 + [
685 + 'method_request' => 'GET',
686 + 'id_url' => 'admin-notices',
687 + 'html_loading_before_show_content' => '',
688 + ],
689 + [
690 + 'class' => AdminNotesTemplate::class,
691 + 'method' => 'render_notices',
692 + ]
693 + );
694 +
695 + wp_enqueue_script( 'lp-admin-notices' );
696 +
697 + echo Template::instance()->nest_elements(
698 + [
699 + '<div class="learn-press-admin-notices notice">' => '</div>',
700 + ],
701 + $html_notices
702 + );
688 703 }
689 704
690 705 /**
691 706 * Admin footer add review.
@@ -800,9 +815,8 @@
800 815 public function includes() {
801 816 // Common function used in admin
802 817 include_once 'lp-admin-functions.php';
803 818 include_once 'lp-admin-actions.php';
804 - require_once LP_PLUGIN_PATH . 'inc/background-process/class-lp-background-query-items.php';
805 819 include_once 'class-lp-admin-assets.php';
806 820 LP_Admin_Assets::instance();
807 821 // For MCP
808 822 if ( learn_press_is_mcp_available() ) {
@@ -817,15 +831,14 @@
817 831 include_once 'class-lp-admin-ajax.php';
818 832 include_once 'editor/class-lp-admin-editor.php';
819 833 include_once 'class-lp-admin-menu.php';
820 834 include_once 'helpers/class-lp-outdated-template-helper.php';
821 - include_once 'helpers/class-lp-plugins-helper.php';
822 835 include_once 'class-lp-modal-search-items.php';
823 836 //include_once 'class-lp-modal-search-users.php';
824 837 include_once 'class-lp-setup-wizard.php';
825 838 // include_once 'class-lp-updater.php';
826 - include_once 'class-lp-install-sample-data.php';
827 - include_once 'class-lp-reset-data.php';
839 + // include_once 'class-lp-install-sample-data.php'; // Replaced by LearnPress\Ajax\SampleDataAJAX.
840 + // include_once 'class-lp-reset-data.php'; // Deprecated: replaced by CourseToolsAjax::reset_progress_items_course.
828 841 include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/course/settings.php';
829 842 include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/course/class-lp-meta-box-course-offline.php';
830 843 include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/quiz/settings.php';
831 844 include_once LP_PLUGIN_PATH . 'inc/admin/views/meta-boxes/lesson/settings.php';