Make WordPress Core


Ignore:
Timestamp:
08/01/2014 06:39:22 PM (10 years ago)
Author:
wonderboymusic
Message:

Clarify that get_the_date(), get_the_time(), get_post_time() and get_post_modified_time() should return false when get_post() is null.

Adds unit tests.

Props GaryJ, SergeyBiryukov, tollmanz.
Fixes #28310.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r29330 r29344  
    2222 * @param string $date      Date string to convert.
    2323 * @param bool   $translate Whether the return date should be translated. Default true.
    24  * @return string|int Formatted date string, or Unix timestamp.
     24 * @return string|int|bool Formatted date string or Unix timestamp. False if $date is empty.
    2525 */
    2626function mysql2date( $format, $date, $translate = true ) {
Note: See TracChangeset for help on using the changeset viewer.