@@ -55,6 +55,7 @@ class Plugin_Importer {
5555 'pods ' => 'init.php ' ,
5656 'wp-full-stripe-free ' => 'wp-full-stripe.php ' ,
5757 'wp-cloudflare-page-cache ' => 'wp-cloudflare-super-page-cache.php ' ,
58+ 'learning-management-system ' => 'lms.php ' ,
5859 );
5960
6061 public function __construct () {
@@ -174,6 +175,7 @@ private function remove_possible_redirects() {
174175 delete_transient ( '_wc_activation_redirect ' );
175176 delete_transient ( 'wpforms_activation_redirect ' );
176177 update_option ( 'themeisle_blocks_settings_redirect ' , false );
178+ update_option ( 'masteriyo_first_time_activation_flag ' , true );
177179 }
178180
179181 /**
@@ -363,6 +365,11 @@ private function maybe_provide_activation_help( $slug, $path ) {
363365 add_filter ( 'woocommerce_create_pages ' , array ( $ this , 'woocommerce_activation_pages ' ) );
364366 }
365367
368+ if ( $ slug === 'learning-management-system ' ) {
369+ // hook into this filter to remove pages on activation of masteriyo
370+ add_filter ( 'masteriyo_create_pages ' , array ( $ this , 'masteriyo_activation_pages ' ) );
371+ }
372+
366373 if ( $ slug === 'estatik ' ) {
367374 update_option ( 'es_is_demo_executed ' , 1 );
368375 }
@@ -386,6 +393,24 @@ public function woocommerce_activation_pages( $pages ) {
386393 return $ pages ;
387394 }
388395
396+ /**
397+ * Filter pages from masteriyo activation.
398+ *
399+ * @param array $pages List of pages to be created on activation.
400+ *
401+ * @return array
402+ */
403+ public function masteriyo_activation_pages ( $ pages ) {
404+ $ filtered_pages = array ( 'courses ' , 'checkout ' , 'account ' , 'learn ' , 'instructor-registration ' , 'instructors-list ' );
405+ foreach ( $ filtered_pages as $ filter ) {
406+ if ( isset ( $ pages [ $ filter ] ) ) {
407+ unset( $ pages [ $ filter ] );
408+ }
409+ }
410+
411+ return $ pages ;
412+ }
413+
389414 /**
390415 * Check if plugin directory exists.
391416 *
0 commit comments