acf_field_time_picker::format_value_for_jsonld
Formats the field value for JSON-LD output.
Returns the stored H:i:s format which is already ISO 8601 compliant.
Метод класса: acf_field_time_picker{}
Хуков нет.
Возвращает
string|null. ISO 8601 formatted time or null.
Использование
$acf_field_time_picker = new acf_field_time_picker(); $acf_field_time_picker->format_value_for_jsonld( $value, $post_id, $field );
- $value(разное) (обязательный)
- The value of the field.
- $post_id(int|строка) (обязательный)
- The ID of the post.
- $field(массив) (обязательный)
- The field array.
Список изменений
| С версии 6.8.0 | Введена. |
Код acf_field_time_picker::format_value_for_jsonld() acf field time picker::format value for jsonld ACF 6.8.11
public function format_value_for_jsonld( $value, $post_id, $field ) {
if ( empty( $value ) || ! is_string( $value ) ) {
return null;
}
// ACF stores time_picker internally as 'H:i:s' which is ISO 8601 compliant.
return $value;
}