WP_Rewrite::add_external_rule()publicWP 2.1.0

Adds a rewrite rule that doesn't correspond to index.php.

Method of the class: WP_Rewrite{}

No Hooks.

Return

null. Nothing.

Usage

global $wp_rewrite;
$wp_rewrite->add_external_rule( $regex, $query );
$regex(string) (required)
Regular expression to match request against.
$query(string) (required)
The corresponding query vars for this rewrite rule.

Changelog

Since 2.1.0 Introduced.

WP_Rewrite::add_external_rule() code WP 6.1.1

public function add_external_rule( $regex, $query ) {
	$this->non_wp_rules[ $regex ] = $query;
}