WordPress at Your Fingertips
function is not described

WP_Rewrite::add_external_rule() public WP 2.1.0

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

{} It's a method of the class: WP_Rewrite{}

No Hooks.


null. Nothing.


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.


Since 2.1.0 Introduced.

Code of WP_Rewrite::add_external_rule() WP 5.9

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