wp_resolve_post_date


wp_resolve_post_date ( $post_date = '', $post_date_gmt = '' )

Parameters:
  • (string) post_date The date in mysql format (`Y-m-d H:i:s`).
  • (string) post_date_gmt The GMT date in mysql format (`Y-m-d H:i:s`).
Returns:
  • (string|false) A valid Gregorian-calendar date string, or false on failure.
Defined at:

Description

Uses wp_checkdate to return a valid Gregorian-calendar value for post_date.If post_date is not provided, this first checks post_date_gmt if provided, then falls back to use the current time. For back-compat purposes in wp_insert_post, an empty post_date and an invalid post_date_gmt will continue to return '1970-01-01 00:00:00' rather than false.

Related Functions

wp_reset_postdata, wp_set_post_cats, _wp_translate_postdata, wp_remote_post, wp_create_post_autosave

Top Google Results

User discussions

wpseek mobile