date_rewrite_rules filter-hookWP 1.5.0

Filters rewrite rules used for date archives.

Likely date archives would include /yyyy/, /yyyy/mm/, and /yyyy/mm/dd/.

Usage

add_filter( 'date_rewrite_rules', 'wp_kama_date_rewrite_rules_filter' );

/**
 * Function for `date_rewrite_rules` filter-hook.
 * 
 * @param string[] $date_rewrite Array of rewrite rules for date archives, keyed by their regex pattern.
 *
 * @return string[]
 */
function wp_kama_date_rewrite_rules_filter( $date_rewrite ){

	// filter...
	return $date_rewrite;
}
$date_rewrite(string[])
Array of rewrite rules for date archives, keyed by their regex pattern.

Changelog

Since 1.5.0 Introduced.

Where the hook is called

WP_Rewrite::rewrite_rules()
date_rewrite_rules
wp-includes/class-wp-rewrite.php 1325
$date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite );

Where the hook is used in WordPress

Usage not found.