(permastructname)_rewrite_rules filter-hookWP 3.1.0

Filters rewrite rules used for individual permastructs.

The dynamic portion of the hook name, $permastructname, refers to the name of the registered permastruct.

Possible hook names include:

Usage

add_filter( '(permastructname)_rewrite_rules', 'wp_kama_permastructname_rewrite_rules_filter' );

/**
 * Function for `(permastructname)_rewrite_rules` filter-hook.
 * 
 * @param string[] $rules Array of rewrite rules generated for the current permastruct, keyed by their regex pattern.
 *
 * @return string[]
 */
function wp_kama_permastructname_rewrite_rules_filter( $rules ){

	// filter...
	return $rules;
}
$rules(string[])
Array of rewrite rules generated for the current permastruct, keyed by their regex pattern.

Changelog

Since 3.1.0 Introduced.

Where the hook is called

WP_Rewrite::rewrite_rules()
(permastructname)_rewrite_rules
wp-includes/class-wp-rewrite.php 1426
$rules = apply_filters( "{$permastructname}_rewrite_rules", $rules );

Where the hook is used in WordPress

Usage not found.