WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Rewrite::preg_index() public WP 1.5.0

Indexes for matches for usage in preg_*() functions.

The format of the string is, with empty matches property value, '$NUM'. The 'NUM' will be replaced with the value in the $number parameter. With the matches property not empty, the value of the returned string will contain that value of the matches property. The format then will be '$MATCHES[NUM]', with MATCHES as the value in the property and NUM the value of the $number parameter.

Это метод класса: WP_Rewrite{}

Хуков нет.

Возвращает

Строку.

Использование

$WP_Rewrite = new WP_Rewrite();
$WP_Rewrite->preg_index( $number );
$number(число) (обязательный)
Index number.

Список изменений

С версии 1.5.0 Введена.

Код WP_Rewrite::preg_index() WP 5.5.1

wp-includes/class-wp-rewrite.php
<?php
public function preg_index( $number ) {
	$match_prefix = '$';
	$match_suffix = '';

	if ( ! empty( $this->matches ) ) {
		$match_prefix = '$' . $this->matches . '[';
		$match_suffix = ']';
	}

	return "$match_prefix$number$match_suffix";
}