Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.


Refreshes the rewrite rules, saving the fresh value to the database.


If the wp_loaded action has not occurred yet, will postpone saving to the database.

Top ↑


File: wp-includes/class-wp-rewrite.php. View all references

private function refresh_rewrite_rules() {
	$this->rules   = '';
	$this->matches = 'matches';


	if ( ! did_action( 'wp_loaded' ) ) {
		 * Is not safe to save the results right now, as the rules may be partial.
		 * Need to give all rules the chance to register.
		add_action( 'wp_loaded', array( $this, 'flush_rules' ) );
	} else {
		update_option( 'rewrite_rules', $this->rules );

Top ↑


Version Description
6.4.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.