Tribe__Rewrite::setup( WP_Rewrite|null $wp_rewrite = null )
When you are going to use any of the functions to create new rewrite rules you need to setup first
Contents
Parameters
- $wp_rewrite
-
(WP_Rewrite|null) (Optional) Pass the WP_Rewrite if you have it
Default value: null
Return
(Tribe__Rewrite) The modified version of the class with the required variables in place
Source
File: src/Tribe/Rewrite.php
public function setup( $wp_rewrite = null ) {
if ( ! $wp_rewrite instanceof WP_Rewrite ) {
global $wp_rewrite;
}
$this->rewrite = $wp_rewrite;
$this->bases = $this->get_bases( 'regex' );
return $this;
}