Tribe__Tickets_Plus__Meta__Field__Birth::get_formatted_value( string|mixed $value )
Get the formatted value.
Contents
Parameters
- $value
-
(string|mixed) (Required) The current value.
Return
(string|mixed) The formatted value.
Source
File: src/Tribe/Meta/Field/Birth.php
public function get_formatted_value( $value ) {
$formatted_value = [
'year' => '',
'month' => '',
'day' => '',
];
if ( ! empty( $value ) ) {
// Format: YYYY-MM-DD.
$value = explode( '-', $value );
if ( 3 === count( $value ) ) {
$formatted_value['year'] = $value[0];
$formatted_value['month'] = $value[1];
$formatted_value['day'] = $value[2];
}
}
return $formatted_value;
}
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |