Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load setup wizard on init to avoid translation errors #2836

Merged
merged 9 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' );
Loading