Skip to content

Commit

Permalink
Load setup wizard on init to avoid translation errors (#2836)
Browse files Browse the repository at this point in the history
* Load setup wizard on init to avoid translation errors.
  • Loading branch information
brianhogg authored Dec 17, 2024
1 parent 6f2ec66 commit b612d64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changelogs/fix_setup-wizard-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: fixed
links:
- "#2835"
entry: Fix translation error during the setup wizard.
12 changes: 4 additions & 8 deletions includes/admin/class.llms.admin.setup.wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public function output_before_importable_course( array $course ): void {
</label>
</div>
<?php

}

/**
Expand Down Expand Up @@ -155,7 +154,6 @@ protected function get_completed_url( array $course_ids ): string {
}

return admin_url( 'edit.php?post_type=course&orderby=date&order=desc' );

}

/**
Expand All @@ -181,7 +179,6 @@ protected function save_coupon() {
}

return $ret;

}

/**
Expand All @@ -194,7 +191,6 @@ protected function save_coupon() {
protected function save_pages() {

return LLMS_Install::create_pages() ? true : new WP_Error( 'llms-setup-pages-save', esc_html__( 'There was an error saving your data, please try again.', 'lifterlms' ) );

}

/**
Expand All @@ -219,7 +215,6 @@ protected function save_payments(): bool {
// phpcs:enable WordPress.Security.NonceVerification.Missing

return true;

}

/**
Expand Down Expand Up @@ -251,9 +246,10 @@ protected function save_finish() {
}

return $gen->get_generated_courses();

}

}

return new LLMS_Admin_Setup_Wizard();
function llms_load_admin_setup_wizard() {
return new LLMS_Admin_Setup_Wizard();
}
add_action( 'init', 'llms_load_admin_setup_wizard' );

0 comments on commit b612d64

Please sign in to comment.