Ticket #28310: 28310.2.diff
| File 28310.2.diff, 3.3 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/general-template.php
1718 1718 * 1719 1719 * @param string $d Optional. PHP date format defaults to the date_format option if not specified. 1720 1720 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. 1721 * @return string Date the current post was written. 1721 * @return string Date the current post was written. Empty string on failure. 1722 1722 */ 1723 1723 function get_the_date( $d = '', $post = null ) { 1724 1724 $post = get_post( $post ); 1725 1725 1726 if ( ! $post ) { 1727 return ''; 1728 } 1729 1726 1730 if ( '' == $d ) { 1727 1731 $the_date = mysql2date( get_option( 'date_format' ), $post->post_date ); 1728 1732 } else { … … 1832 1836 * was written. Either 'G', 'U', or php date format defaults 1833 1837 * to the value specified in the time_format option. Default empty. 1834 1838 * @param int|WP_Post $post WP_Post object or ID. Default is global $post object. 1835 * @return string|int Formatted date string , or Unix timestamp.1839 * @return string|int Formatted date string or Unix timestamp. Empty string on failure. 1836 1840 */ 1837 1841 function get_the_time( $d = '', $post = null ) { 1838 1842 $post = get_post($post); 1839 1843 1844 if ( ! $post ) { 1845 return ''; 1846 } 1847 1840 1848 if ( '' == $d ) 1841 1849 $the_time = get_post_time(get_option('time_format'), false, $post, true); 1842 1850 else … … 1866 1874 * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false. 1867 1875 * @param int|WP_Post $post WP_Post object or ID. Default is global $post object. 1868 1876 * @param bool $translate Whether to translate the time string. Default false. 1869 * @return string|int Formatted date string , or Unix timestamp.1877 * @return string|int Formatted date string or Unix timestamp. Empty string on failure. 1870 1878 */ 1871 1879 function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1872 1880 $post = get_post($post); 1873 1881 1882 if ( ! $post ) { 1883 return ''; 1884 } 1885 1874 1886 if ( $gmt ) 1875 1887 $time = $post->post_date_gmt; 1876 1888 else … … 1944 1956 * 1945 1957 * @since 2.0.0 1946 1958 * 1947 * @param string $d Optional, default is 'U'. Either 'G', 'U', or php date format. 1948 * @param bool $gmt Optional, default is false. Whether to return the gmt time. 1949 * @param int|object $post Optional, default is global post object. A post_id or post object 1950 * @param bool $translate Optional, default is false. Whether to translate the result 1951 * @return string Returns timestamp 1959 * @param string $d Optional. Format to use for retrieving the time the post 1960 * was modified. Either 'G', 'U', or php date format. Default 'U'. 1961 * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false. 1962 * @param int|WP_Post $post WP_Post object or ID. Default is global $post object. 1963 * @param bool $translate Whether to translate the time string. Default false. 1964 * @return string|int Formatted date string or Unix timestamp. Empty string on failure. 1952 1965 */ 1953 1966 function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1954 1967 $post = get_post($post); 1955 1968 1969 if ( ! $post ) { 1970 return ''; 1971 } 1972 1956 1973 if ( $gmt ) 1957 1974 $time = $post->post_modified_gmt; 1958 1975 else