Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#24781 closed enhancement (wontfix)

Deprecate the_weekday() and the_weekday_date()

Reported by: DrewAPicture Owned by:
Priority: normal Milestone:
Component: Date/Time Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

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)

24781.diff​ (3.0 KB ) - added by DrewAPicture 13 years ago.

Download all attachments as: .zip

Change History (7)

#1 follow-up: @nacin
13 years ago

the_weekday_date() was partially broken until a change in 3.6 to declare a referenced global.

#2 in reply to: ↑ 1 ; follow-up: @rmccue
13 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 @nacin
13 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: @DrewAPicture
13 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?

Last edited 13 years ago by DrewAPicture (previous) (diff)

#5 in reply to: ↑ 4 @SergeyBiryukov
13 years ago

Replying to DrewAPicture:

Turns out the $translate parameter in mysql2date() defaults to true, which means get_the_date() and in turn the_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().

#6 @DrewAPicture
13 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed
  • Type defect (bug) → enhancement

Sounds like we're gonna keep 'em.

Note: See TracTickets for help on using tickets.