PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.10
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.10
4.4.10 4.4.9.1 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 All 142 releases
← All changes | inc/Ajax/SetupWizardAjax.php +5 -2 4.4.9 → 4.4.10 View file →
@@ -16,10 +16,10 @@
16 16 use LearnPress\Services\SetupDemoCourseService;
17 17 use LP_Emails;
18 18 use LP_Helper;
19 19 use LP_Request;
20 -use LP_Settings;
21 20 use LP_Settings_Cache;
21 +use LP_Setup_Wizard;
22 22 use Throwable;
23 23
24 24 defined( 'ABSPATH' ) || exit;
25 25
@@ -152,8 +152,11 @@
152 152 *
153 153 * @return void
154 154 */
155 155 protected function save_pages() {
156 + // LP_Setup_Wizard is only loaded in admin context, so need include here to use.
157 + include_once LP_PLUGIN_PATH . 'inc/admin/class-lp-setup-wizard.php';
158 +
156 159 $page_keys = array(
157 160 'courses_page_id',
158 161 'instructors_page_id',
159 162 'single_instructor_page_id',
@@ -166,9 +169,9 @@
166 169 foreach ( $page_keys as $page_key ) {
167 170 $option_key = 'learn_press_' . $page_key;
168 171 $page_id = (int) get_option( $option_key );
169 172 if ( ! $page_id || 'publish' !== get_post_status( $page_id ) ) {
170 - $page_id = (int) \LP_Setup_Wizard::instance()->create_page( $page_key );
173 + $page_id = (int) LP_Setup_Wizard::instance()->create_page( $page_key );
171 174 if ( $page_id ) {
172 175 update_option( $option_key, $page_id );
173 176 }
174 177 }