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

Fix permalink/rewrite rule issue on activation #2492

merged 1 commit into from Mar 19, 2019


None yet
3 participants
Copy link

commented Mar 19, 2019

If courses already existed in database and then we reactivate Sensei, we would need to go into Permalink settings (or save a course) before the rewrite rules would flush with the registered post type. This should fix that issue.

Testing Instructions

  • Activate Sensei. Create a course. View that course (frontend) in another tab.
  • Deactivate Sensei.
  • Activate Sensei again. Refresh the frontend course and make sure it is still accessible.

@jom jom added this to the 2.0.0 milestone Mar 19, 2019

@jom jom requested review from alexsanford and donnapep Mar 19, 2019

@jom jom changed the base branch from master to release/2.0 Mar 19, 2019


This comment has been minimized.

Copy link

commented Mar 19, 2019

I just read but can you remind me, why in Sensei's case flushing rules directly on activation hook won't work? Do we have dynamic post types of some sort, registered only after activation hook triggers, or...?


This comment has been minimized.

Copy link
Member Author

commented Mar 19, 2019

@lkraav I imagine it is because we register our post types on init, which has already been fired when the activation hook runs here so our post types wouldn't be registered if we flush directly. We also add our own rewrite tag/rule on init on includes/class-sensei-course-results.php.

We could set up an activation method that calls those post type registration methods and rewrite rule setup, but thought I'd use this functionality that Sensei already has.

Copy link

left a comment

Works for me!

@jom jom merged commit 7d6aac6 into release/2.0 Mar 19, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed

@jom jom deleted the fix/rewrite-rules-on-activation branch Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.