WP_URL_Pattern_Prefixer::__construct
Constructor.
Method of the class: WP_URL_Pattern_Prefixer{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_URL_Pattern_Prefixer = new WP_URL_Pattern_Prefixer(); $WP_URL_Pattern_Prefixer->__construct( $contexts );
- $contexts(array<string, string>)
- Map of
$context_string => $base_pathpairs.
Default:contexts returned by the {@see WP_URL_Pattern_Prefixer::get_default_contexts()} method
Changelog
| Since 6.8.0 | Introduced. |
WP_URL_Pattern_Prefixer::__construct() WP URL Pattern Prefixer:: construct code WP 7.1
public function __construct( array $contexts = array() ) {
if ( count( $contexts ) > 0 ) {
$this->contexts = array_map(
static function ( string $str ): string {
return self::escape_pattern_string( trailingslashit( $str ) );
},
$contexts
);
} else {
$this->contexts = self::get_default_contexts();
}
}