-
Notifications
You must be signed in to change notification settings - Fork 197
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
Redirect to sample course after importing it #3545
Conversation
@@ -78,6 +79,7 @@ private function __construct() { | |||
*/ | |||
public function init() { | |||
add_action( 'init', [ $this, 'maybe_schedule_cron_jobs' ] ); | |||
add_action( 'init', [ $this, 'redirect_imported_sample' ], 101 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this redirect work on admin_init
or is it too late? If it works, it might be nice to limit the amount this is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! It works!
Updated here: 7932346
14193fa
to
5147212
Compare
5147212
to
5aa6530
Compare
5aa6530
to
54aa8dd
Compare
678cdbd
to
d29524e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good; works well! Let's temporarily remove branch restrictions to merge.
Close #3535
Changes proposed in this Pull Request
@donnapep asked here to redirect the user to the imported course after the sample course installing.
Talking with @jom, as an alternative to #3535, we decided to go with a solution with less code. With that, we're trusting that our sample will always have an ID. (We created a test to ensure)
Testing instructions
Install a sample course
.