Allow wc_rest_prepare_date_response() handle timestamps

This commit is contained in:
Claudio Sanches 2016-11-10 17:23:17 -02:00
parent da72a76089
commit 78c53a84b8
1 changed files with 4 additions and 0 deletions

View File

@ -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;