Skip to content

Instantly share code, notes, and snippets.

@vanbernaert
Created December 13, 2017 11:00
Show Gist options
  • Save vanbernaert/71b79ef44fcb9d5631371d93559c9702 to your computer and use it in GitHub Desktop.
Save vanbernaert/71b79ef44fcb9d5631371d93559c9702 to your computer and use it in GitHub Desktop.
Keep WordPress Post Date & Time on current time
wp_update_post(
array (
'ID' => 101, // ID of the post to update
'post_date' => $time,
'post_date_gmt' => get_gmt_from_date( $time )
)
);
@vanbernaert
Copy link
Author

for example for posts presented in a timeline to keep a post permanent on top ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment