WPSEO_Replace_Vars::is_not_prefixed()privateYoast 1.0

Checks whether the replacement variable contains a ct_ or cf_ prefix, because they follow different logic.

Метод класса: WPSEO_Replace_Vars{}

Хуков нет.

Возвращает

true|false. True when the replacement variable is not prefixed.

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

// private - только в коде основоного (родительского) класса
$result = $this->is_not_prefixed( $replacement_variable );
$replacement_variable(строка) (обязательный)
The replacement variable.

Код WPSEO_Replace_Vars::is_not_prefixed() Yoast 22.4

private function is_not_prefixed( $replacement_variable ) {
	$prefixes = [ 'cf_', 'ct_' ];
	$prefix   = $this->get_prefix( $replacement_variable );

	return ! in_array( $prefix, $prefixes, true );
}