WP_URL_Pattern_Prefixer::__construct
Constructor.
Метод класса: WP_URL_Pattern_Prefixer{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$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.
По умолчанию:contexts returned by the {@see WP_URL_Pattern_Prefixer::get_default_contexts()} method
Список изменений
| С версии 6.8.0 | Введена. |
Код WP_URL_Pattern_Prefixer::__construct() WP URL Pattern Prefixer:: construct 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();
}
}