category_rewrite_rules filter-hookWP 3.1.0

Filters rewrite rules used for individual permastructs.

This is one of the variants of the dynamic hook (permastructname)_rewrite_rules

Usage

add_filter( 'category_rewrite_rules', 'wp_kama_category_rewrite_rules_filter' );

/**
 * Function for `category_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_category_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()
category_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.