root_rewrite_rules хук-фильтрWP 1.5.0

Filters rewrite rules used for root-level archives.

Likely root-level archives would include pagination rules for the homepage as well as site-wide post feeds (e.g. /feed/, and /feed/atom/).

Использование

add_filter( 'root_rewrite_rules', 'wp_kama_root_rewrite_rules_filter' );

/**
 * Function for `root_rewrite_rules` filter-hook.
 * 
 * @param string[] $root_rewrite Array of root-level rewrite rules, keyed by their regex pattern.
 *
 * @return string[]
 */
function wp_kama_root_rewrite_rules_filter( $root_rewrite ){

	// filter...
	return $root_rewrite;
}
$root_rewrite(string[])
Array of root-level rewrite rules, keyed by their regex pattern.

Список изменений

С версии 1.5.0 Введена.

Где вызывается хук

WP_Rewrite::rewrite_rules()
root_rewrite_rules
wp-includes/class-wp-rewrite.php 1339
$root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite );

Где используется хук в WordPress

Использование не найдено.