Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#36414 closed enhancement (fixed)

Replacing confusing legacy code with core recommended method

Reported by: tloureiro's profile tloureiro Owned by: ocean90's profile ocean90
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch dev-feedback
Focuses: Cc:


General template weekly archive link URL constructor was using a confusing method to generate query string:

sprintf( '%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&amp;', '=', $result->week );

Replaced with add_query_arg function call

Attachments (1)

general-template.diff (1.2 KB) - added by tloureiro 8 years ago.
general-template.php patch

Download all attachments as: .zip

Change History (5)

8 years ago

general-template.php patch

#1 @tloureiro
8 years ago

  • Keywords has-patch dev-feedback added

#2 @chriscct7
8 years ago

  • Version trunk deleted

#3 @ocean90
8 years ago

  • Milestone changed from Awaiting Review to 4.6
  • Owner set to ocean90
  • Status changed from new to reviewing

#4 @ocean90
8 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 37530:

Template: In wp_get_archives() use add_query_arg() instead of sprintf() to build the archive URL.

Props tloureiro.
Fixes #36414.

Note: See TracTickets for help on using tickets.