Skip to content

Instantly share code, notes, and snippets.

@Garconis
Last active April 25, 2019 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Garconis/2234cc238ba4d0fab27644b1741ac995 to your computer and use it in GitHub Desktop.
Save Garconis/2234cc238ba4d0fab27644b1741ac995 to your computer and use it in GitHub Desktop.
WP All Export | Ensure post dates are pulled from actual time and not GMT date
<?php
/** In WP All Export, add a new ID field and give it a custom Column Name, then...
* set the field to "Export the value returned by a PHP function"...
* where the function name is fs_format_get_date ...
* then add this function to the Function Editor, so that...
* the column in the export will use the proper date timezone and post time, rather than the "post_date_gmt" value
*/
function fs_format_get_date ($id) {
$new_date = get_the_date($d = 'Y-m-d H:i:s', $id);
return $new_date;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment