Opened 12 years ago
Closed 11 years ago
#24781 closed enhancement (wontfix)
Deprecate the_weekday() and the_weekday_date()
Reported by: | DrewAPicture | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Date/Time | Keywords: | has-patch |
Focuses: | Cc: |
Description
We should deprecate the_weekday()
and the_weekday_date()
. Both are original b2 functions that even before WordPress 0.71 were marked obsolete in the readme. They're also not used in core.
A search of the plugins repo returned eight code editor plugins and one unit testing plugin, so it might be safe to remove them after 10+ years.
Each contain a like-named filter.
Attachments (1)
Change History (7)
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
12 years ago
Replying to nacin:
the_weekday_date() was partially broken until a change in 3.6 to declare a referenced global.
Given this, deprecation sounds like it won't break anything. That said, I'd expect this is used more in themes than plugins, so checking plugins is probably not a good indication of use.
#3
in reply to:
↑ 2
@
12 years ago
Replying to rmccue:
I'd expect this is used more in themes than plugins, so checking plugins is probably not a good indication of use.
Indeed, especially older themes. This is a template tag; like many template tags, they aren't going to be directly used by core.
#4
follow-up:
↓ 5
@
12 years ago
At first glance, I thought they were the only way to retrieve the localized day names because they use WP_Locale::get_weekday()
.
Turns out the $translate
parameter in mysql2date()
defaults to true, which means get_the_date()
and in turn the_date()
output localized values. Therefore the_weekday()
is the same as the_date( 'l' )
.
On that same token, I'm not sure which global @nacin was referring to in the_weekday_date()
, but I can't quite figure out what its purpose is in relation to the_weekday()
— to not display the current post's day if it's different from the previous one? Is that the previous post's day? Why?
#5
in reply to:
↑ 4
@
12 years ago
Replying to DrewAPicture:
Turns out the
$translate
parameter inmysql2date()
defaults to true, which meansget_the_date()
and in turnthe_date()
output localized values.
Correct, also noted in ticket:23918:6.
On that same token, I'm not sure which global @nacin was referring to in
the_weekday_date()
,
$currentday
, see [24189].
but I can't quite figure out what its purpose is in relation to
the_weekday()
— to not display the current post's day if it's different from the previous one? Is that the previous post's day? Why?
As stated in the inline docs, the_weekday_date()
only displays the weekday if the current post's weekday is different from the previous output. Looks like the idea is the same as in the_date() vs. the_time().
the_weekday_date() was partially broken until a change in 3.6 to declare a referenced global.