Make WordPress Core

Opened 8 years ago

Closed 5 years ago

#40499 closed enhancement (wontfix)

the_archive_title() doesn't honour date format setting

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: template Cc:

Description

the_archive_title() will output a title such as the following if the current page is a date archive.

Day: April 12, 2017

This date isn't in the format as set in Settings > General.

Change History (5)

#1 follow-up: @johnbillion
8 years ago

  • Component changed from General to Formatting
  • Focuses template added
  • Keywords close added

The date and time format settings have always been a little confusing because they're not actually used in many places in core and in themes.

In this case, the date format is explicitly set to F j, Y as it's a day archive. For month archives it's set to F Y. I don't think it makes sense for the date format setting to be used here.

#2 @henry.wright
8 years ago

Fair enough, John. Thanks for looking.

#3 in reply to: ↑ 1 @knutsp
8 years ago

Replying to johnbillion:

In this case, the date format is explicitly set to F j, Y as it's a day archive. For month archives it's set to F Y. I don't think it makes sense for the date format setting to be used here.

Why not? This is poor internationalisation.

For day archive it should be used. For month, either a special filterable setting or just 'Y-m'.

#4 @johnbillion
8 years ago

The date format is internationalised with _x(), it just doesn't use the value from the Date Format setting.

get_the_date( _x( 'F Y', 'monthly archives date format' ) ) 

#5 @pento
5 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.