Skip to content

Commit

Permalink
Merge pull request #544 from diedexx/patch-1
Browse files Browse the repository at this point in the history
Don't flush rewrite_rules on every admin request
  • Loading branch information
westonruter authored Jun 25, 2021
2 parents f9fc1cb + acd973f commit ee75ca8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wp-includes/class-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
function pwa_add_rewrite_rules() {
global $wp_rewrite;
$rewrite_rule_regex = '^wp\.serviceworker$';
$rules = $wp_rewrite->wp_rewrite_rules();

if ( ! isset( $wp_rewrite->extra_rules_top[ $rewrite_rule_regex ] ) ) {
if ( ! isset( $rules[ $rewrite_rule_regex ] ) ) {
// Note: This logic will not be required as part of core merge since rewrite rules are flushed upon DB upgrade (as long as the DB version is bumped).
add_action(
'admin_init',
Expand Down

0 comments on commit ee75ca8

Please sign in to comment.