WordPress at a glance

flush_rewrite_rules() WP 1.0

Remove rewrite rules and then recreate rewrite rules.

  • Global. WP_Rewrite. $wp_rewrite
✈ 1 time = 0.010174s = extreme slow | 50000 times = 196.39s = extreme slow PHP 7.1.11, WP 4.9.8

No Hooks.

Return

Nothing (null).

Usage

flush_rewrite_rules( $hard );
$hard(true/false)
Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush).
Default: true (hard)

Code of flush_rewrite_rules: wp-includes/rewrite.php VER 4.9.8

<?php
function flush_rewrite_rules( $hard = true ) {
	global $wp_rewrite;
	$wp_rewrite->flush_rules( $hard );
}

Related Functions

From tag: Rewrite (clean friendly URL)

No comments
    Hello, !     Log In . Register