WP_URL_Pattern_Prefixer::__constructpublicWP 6.8.0

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)
.
Default: array()

Changelog

Since 6.8.0 Introduced.

WP_URL_Pattern_Prefixer::__construct() code WP 6.8.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();
	}
}