Yoast\WP\SEO\Abilities\Infrastructure

Global_Setting_Field_Map::target_has_field │ public │ Yoast 1.0

Returns whether a target has a field, without formatting its option name.

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

Хуков нет.

Возвращает

bool. Whether the field exists and the target has it.

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

$Global_Setting_Field_Map = new Global_Setting_Field_Map();
$Global_Setting_Field_Map->target_has_field( $field_name, $target ): bool;
$field_name(строка) (обязательный)
The name of the field.
$target(Global_Setting_Target_Interface) (обязательный)
The target.

Код Global_Setting_Field_Map::target_has_field() Yoast 28.9

public function target_has_field( string $field_name, Global_Setting_Target_Interface $target ): bool {
	// The option patterns are resolved along with the fields.
	$this->get_fields();

	return isset( $this->option_patterns[ $field_name ][ $target->get_name() ] );
}