Rewrite Rules: Prevent stampedes when flush_rewrite_rules() is called

This ensures that the `rewrite_rules` option is not emptied until the new value has been recalculated and the option is updated. The logic for refreshing the option value is moved to a new private method named `WP_Rewrite::refresh_rewrite_rules` which is used by both the `flush_rules` and `refresh_rewrite_rules` methods.

Props iCaleb, joemcgill, flixos90, mukesh27.
Fixes #58998.

Built from https://develop.svn.wordpress.org/trunk@56448


git-svn-id: http://core.svn.wordpress.org/trunk@55960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe McGill
2023-08-24 15:57:17 +00:00
parent 1840a5550a
commit 64e114f233
2 changed files with 26 additions and 10 deletions

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-alpha-56447';
$wp_version = '6.4-alpha-56448';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.