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

No longer flush rewrite rules on course and lesson save #2718

merged 6 commits into from Oct 16, 2019


Copy link

jom commented Jun 10, 2019

Fixes #2142

Changes Proposed in PR

  • Instead of checking for a pending rewrite flush on init, 26cac49 changes it to admin_init only. It is an expensive operation to do (when triggered) and everything that triggers Sensei's rewrite rule flush happens from the admin.
  • Removes triggering Sensei's rewrite rule flush on lesson (7366d2b) and course save (9980bef). This was unnecessary as none of the rules care are for specific courses and lessons.
  • Triggers Sensei's rewrite rule flush on update. This seems like a safe time to initiate this process in case anything changed on plugin update.

Testing Instructions

  • Under WP Admin > Settings > Permalinks, set to an option other than Plain.
  • On a brand new instance, install and activate Sensei.
  • Create a course and lessons for that course.
  • View the course. Make sure the permalink works for the course.
  • Complete the course.
  • When viewing the course, append /results on the end. For example:
  • Make sure that goes to an expected page.
@jom jom requested review from roundhill, alexsanford and donnapep Jun 10, 2019
@jom jom self-assigned this Jun 10, 2019

This comment has been minimized.

Copy link
Member Author

jom commented Jun 10, 2019

@jom jom changed the title Flush rewrite rules on install and update only No longer flush rewrite rules on course and lesson save Jun 10, 2019
Copy link

roundhill left a comment

Tested well for me 👍

includes/class-sensei-settings.php Show resolved Hide resolved
Copy link

donnapep left a comment

We should probably deprecate the flush_rewrite_rules functions instead of removing them.

includes/class-sensei-course.php Show resolved Hide resolved
includes/class-sensei-lesson.php Show resolved Hide resolved
@donnapep donnapep added this to the 2.2.1 milestone Oct 16, 2019
@jom jom merged commit 08c5421 into master Oct 16, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
@jom jom deleted the change/rewrite-flush branch Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.