WP_Rewrite::add_external_rule()
Adds a rewrite rule that doesn't correspond to index.php.
Method of the class: WP_Rewrite{}
No Hooks.
Return
null
. Nothing (null).
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() WP Rewrite::add external rule code WP 6.7.1
public function add_external_rule( $regex, $query ) { $this->non_wp_rules[ $regex ] = $query; }