rewrite_rules_array filter-hookWP 1.5.0

Filters the full set of generated rewrite rules.

Usage

add_filter( 'rewrite_rules_array', 'wp_kama_rewrite_rules_array_filter' );

/**
 * Function for `rewrite_rules_array` filter-hook.
 * 
 * @param string[] $rules The compiled array of rewrite rules, keyed by their regex pattern.
 *
 * @return string[]
 */
function wp_kama_rewrite_rules_array_filter( $rules ){

	// filter...
	return $rules;
}
$rules(string[])
The compiled array of rewrite rules, keyed by their regex pattern.

Changelog

Since 1.5.0 Introduced.

Where the hook is called

WP_Rewrite::rewrite_rules()
rewrite_rules_array
wp-includes/class-wp-rewrite.php 1467
$this->rules = apply_filters( 'rewrite_rules_array', $this->rules );

Where the hook is used in WordPress

Usage not found.