$changeset_date_gmt = null;
if ( isset( $_POST['customize_changeset_date'
] ) ) { $changeset_date =
wp_unslash( $_POST['customize_changeset_date'
] );
if ( preg_match( '/^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/',
$changeset_date ) ) { $mm =
substr( $changeset_date, 5, 2
);
$jj =
substr( $changeset_date, 8, 2
);
$aa =
substr( $changeset_date, 0, 4
);
$valid_date =
wp_checkdate( $mm,
$jj,
$aa,
$changeset_date );
if ( !
$valid_date ) { wp_send_json_error( 'bad_customize_changeset_date', 400
);
} $changeset_date_gmt =
get_gmt_from_date( $changeset_date );
} else { $timestamp =
strtotime( $changeset_date );
if ( !
$timestamp ) { wp_send_json_error( 'bad_customize_changeset_date', 400
);
} $changeset_date_gmt =
gmdate( 'Y-m-d H:i:s',
$timestamp );
} }