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.
Method of the class: acf_field_time_picker{}
No Hooks.
Returns
string|null. ISO 8601 formatted time or null.
Usage
$acf_field_time_picker = new acf_field_time_picker(); $acf_field_time_picker->format_value_for_jsonld( $value, $post_id, $field );
- $value(mixed) (required)
- The value of the field.
- $post_id(int|string) (required)
- The ID of the post.
- $field(array) (required)
- The field array.
Changelog
| Since 6.8.0 | Introduced. |
acf_field_time_picker::format_value_for_jsonld() acf field time picker::format value for jsonld code ACF 6.8.8
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;
}