Allow wc_rest_prepare_date_response() handle timestamps
This commit is contained in:
parent
da72a76089
commit
78c53a84b8
|
@ -25,6 +25,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* @return string|null ISO8601/RFC3339 formatted datetime.
|
||||
*/
|
||||
function wc_rest_prepare_date_response( $date ) {
|
||||
if ( false === strpos( $date, '-' ) ) {
|
||||
$date = date( 'Y-m-d H:i:s', $date );
|
||||
}
|
||||
|
||||
// Check if mysql_to_rfc3339 exists first!
|
||||
if ( ! function_exists( 'mysql_to_rfc3339' ) ) {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue