tag_rewrite_rules filter-hookWP 2.3.0

Deprecated from version 3.1.0. It is no longer supported and can be removed in future releases. See post_tag_rewrite_rules.

Deprecated: 3.1.0 Use {@see 'post_tag_rewrite_rules'} instead.

Filters rewrite rules used specifically for Tags.

Usage

add_filter( 'tag_rewrite_rules', 'wp_kama_tag_rewrite_rules_filter', 10, 2 );

/**
 * Function for `tag_rewrite_rules` filter-hook.
 * 
 * @param string[] $rules  Array of rewrite rules generated for tags, keyed by their regex pattern.
 * @param          $string 
 *
 * @return string[]
 */
function wp_kama_tag_rewrite_rules_filter( $rules, $string ){

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

Changelog

Since 2.3.0 Introduced.
Deprecated Since 3.1.0 Use {@see 'post_tag_rewrite_rules'} instead.

Where the hook is called

WP_Rewrite::rewrite_rules()
tag_rewrite_rules
wp-includes/class-wp-rewrite.php 1438
$rules = apply_filters_deprecated( 'tag_rewrite_rules', array( $rules ), '3.1.0', 'post_tag_rewrite_rules' );

Where the hook is used in WordPress

Usage not found.