WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#36414 closed enhancement (fixed)

Replacing confusing legacy code with core recommended method

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

Description

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

<?php
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 4 years ago.
general-template.php patch

Download all attachments as: .zip

Change History (5)

@tloureiro
4 years ago

general-template.php patch

#1 @tloureiro
4 years ago

  • Keywords has-patch dev-feedback added

#2 @chriscct7
4 years ago

  • Version trunk deleted

#3 @ocean90
3 years ago

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

#4 @ocean90
3 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.