#4: the_weekday_date

The the_weekday_date filter makes it possible to change the displayed day of the week a post was published, when the function of the same name — the_weekday_date() — is used inside the Loop.

It is located in wp-includes/general-template.php and the_weekday_date() only outputs the day if the current post’s weekday is different from the previous one output (why this would be needed, I have no idea).

The filter accepts three arguments:

  1. string $the_weekday_date The day of the week
  2. string $before Text or markup before
  3. string $after Text or markup after

The original value of $the_weekday_date is determined using a chain of functions to snag the localized day of the week:

  • the get_weekday() method of the WP_Locale class
  • mysql2date()

Example:

Let’s say you wanted to convert the day ‘Saturday’ into pirate-speak, something like ‘SatARRRday’ and were using the_weekday_date() to output it in the Loop.