| 1 | @@ -1362,10 +1362,14 @@ |
|---|
| 2 | * @since 3.0.0 |
|---|
| 3 | * |
|---|
| 4 | * @param string $d Optional. PHP date format defaults to the date_format option if not specified. |
|---|
| 5 | + * @param object $post Optional. Post object, if wanting the formatted date string for a post besides the global $post. |
|---|
| 6 | * @return string|null Null if displaying, string if retrieving. |
|---|
| 7 | */ |
|---|
| 8 | -function get_the_date( $d = '' ) { |
|---|
| 9 | - global $post; |
|---|
| 10 | +function get_the_date( $d = '', $post = null ) { |
|---|
| 11 | + if (is_null($post)) { |
|---|
| 12 | + global $post; |
|---|
| 13 | + } |
|---|
| 14 | + |
|---|
| 15 | $the_date = ''; |
|---|
| 16 | |
|---|
| 17 | if ( '' == $d ) |
|---|