Ticket #28310: 28310.3.diff
File 28310.3.diff, 3.9 KB (added by , 11 years ago) |
---|
-
src/wp-includes/functions.php
21 21 * @param string $format Format of the date to return. 22 22 * @param string $date Date string to convert. 23 23 * @param bool $translate Whether the return date should be translated. Default is 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. 25 25 */ 26 26 function mysql2date( $format, $date, $translate = true ) { 27 27 if ( empty( $date ) ) -
src/wp-includes/general-template.php
1722 1722 * 1723 1723 * @param string $d Optional. PHP date format defaults to the date_format option if not specified. 1724 1724 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. 1725 * @return string Date the current post was written.1725 * @return string|bool Date the current post was written. False on failure. 1726 1726 */ 1727 1727 function get_the_date( $d = '', $post = null ) { 1728 1728 $post = get_post( $post ); 1729 1729 1730 if ( ! $post ) { 1731 return false; 1732 } 1733 1730 1734 if ( '' == $d ) { 1731 1735 $the_date = mysql2date( get_option( 'date_format' ), $post->post_date ); 1732 1736 } else { … … 1836 1840 * was written. Either 'G', 'U', or php date format defaults 1837 1841 * to the value specified in the time_format option. Default empty. 1838 1842 * @param int|WP_Post $post WP_Post object or ID. Default is global $post object. 1839 * @return string|int Formatted date string, or Unix timestamp.1843 * @return string|int|bool Formatted date string or Unix timestamp. False on failure. 1840 1844 */ 1841 1845 function get_the_time( $d = '', $post = null ) { 1842 1846 $post = get_post($post); 1843 1847 1848 if ( ! $post ) { 1849 return false; 1850 } 1851 1844 1852 if ( '' == $d ) 1845 1853 $the_time = get_post_time(get_option('time_format'), false, $post, true); 1846 1854 else … … 1870 1878 * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false. 1871 1879 * @param int|WP_Post $post WP_Post object or ID. Default is global $post object. 1872 1880 * @param bool $translate Whether to translate the time string. Default false. 1873 * @return string|int Formatted date string, or Unix timestamp.1881 * @return string|int|bool Formatted date string or Unix timestamp. False on failure. 1874 1882 */ 1875 1883 function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1876 1884 $post = get_post($post); 1877 1885 1886 if ( ! $post ) { 1887 return false; 1888 } 1889 1878 1890 if ( $gmt ) 1879 1891 $time = $post->post_date_gmt; 1880 1892 else … … 1948 1960 * 1949 1961 * @since 2.0.0 1950 1962 * 1951 * @param string $d Optional, default is 'U'. Either 'G', 'U', or php date format. 1952 * @param bool $gmt Optional, default is false. Whether to return the gmt time. 1953 * @param int|object $post Optional, default is global post object. A post_id or post object 1954 * @param bool $translate Optional, default is false. Whether to translate the result 1955 * @return string Returns timestamp 1963 * @param string $d Optional. Format to use for retrieving the time the post 1964 * was modified. Either 'G', 'U', or php date format. Default 'U'. 1965 * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false. 1966 * @param int|WP_Post $post WP_Post object or ID. Default is global $post object. 1967 * @param bool $translate Whether to translate the time string. Default false. 1968 * @return string|int|bool Formatted date string or Unix timestamp. False on failure. 1956 1969 */ 1957 1970 function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1958 1971 $post = get_post($post); 1959 1972 1973 if ( ! $post ) { 1974 return false; 1975 } 1976 1960 1977 if ( $gmt ) 1961 1978 $time = $post->post_modified_gmt; 1962 1979 else