Yoast\WP\SEO\Abilities\Infrastructure
Global_Setting_Field_Map::get_option_name
Returns the option a field is stored in for a target.
Метод класса: Global_Setting_Field_Map{}
Хуков нет.
Возвращает
string|null. The option name, or null when the field does not exist or the target does not have it.
Использование
$Global_Setting_Field_Map = new Global_Setting_Field_Map(); $Global_Setting_Field_Map->get_option_name( $field_name, $target ): ?string;
- $field_name(строка) (обязательный)
- The name of the field.
- $target(Global_Setting_Target_Interface) (обязательный)
- The target.
Код Global_Setting_Field_Map::get_option_name() Global Setting Field Map::get option name Yoast 28.9
public function get_option_name( string $field_name, Global_Setting_Target_Interface $target ): ?string {
if ( ! $this->target_has_field( $field_name, $target ) ) {
return null;
}
return $target->format_option_name( $this->option_patterns[ $field_name ][ $target->get_name() ] );
}