wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_flush_rewrite_rules_on_site_language_change › WordPress Function

Od7.2.0
Przestarzałyn/a
› wp_flush_rewrite_rules_on_site_language_change ( Brak parametrów )
Zdefiniowane na:
Codex:

Clears the rewrite rules when the site language changes.

Rewrite rules can contain translated slugs, such as the default random content base, see WP_Rewrite::get_random_base. Clearing the rules causes them to be regenerated in the new site language. The rules are regenerated on the next request rather than immediately, because the new language is not loaded until after the option is saved. Clearing the rules also avoids rewriting the .htaccess file. Runs on the {@see 'add_option_WPLANG'} and {@see 'update_option_WPLANG'} actions.


Źródło

function wp_flush_rewrite_rules_on_site_language_change(): void {
	update_option( 'rewrite_rules', '' );
}