Opened 13 years ago
Closed 13 years ago
#27181 closed enhancement (fixed)
get_the_date() - useless var and concatenation
| Reported by: | juliobox | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | low | Milestone: | 3.9 |
| Component: | Date/Time | Version: | 3.0 |
| Severity: | trivial | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description (last modified by )
Hello
Function get_the_date():
function get_the_date( $d = '' ) {
$post = get_post();
$the_date = '';
if ( '' == $d )
$the_date .= mysql2date(get_option('date_format'), $post->post_date);
else
$the_date .= mysql2date($d, $post->post_date);
return apply_filters('get_the_date', $the_date, $d);
}
$the_date = ''; is useless.
So the 2 .= are useless too.
My 2 cents ;)
Attachments (4)
Change History (12)
#2
@
13 years ago
- Keywords has-patch commit added
- Milestone Awaiting Review → 3.9
- Priority normal → low
- Severity normal → trivial
#5
@
13 years ago
- Resolution fixed
- Status closed → reopened
Argh, I'm too slow today :-) I had a slightly different simplification, but that's ok.
We might however as well fix the inline docs of get_the_date() while working on it.
#6
@
13 years ago
27181.2.patch would change the $d value passed to the filter, but the docs fix looks good.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thank you Sergey!