Ticket #19871 (closed enhancement: fixed)

Opened 5 weeks ago

Last modified 4 weeks ago

add_rewrite_tag() should take same params as WP_Rewrite::add_rewrite_tag()

Reported by: duck_ Owned by: duck_
Priority: normal Milestone: 3.4
Component: Rewrite Rules Version: 2.1
Severity: normal Keywords: has-patch
Cc: scribu

Description

The function and instance method have different signatures:

add_rewrite_tag( $tagname, $regex )

vs.

WP_Rewrite::add_rewrite_tag( $tag, $pattern, $query )

add_rewrite_tag() should have a third parameter too.

See: #2433 and [3638]

Attachments

19871.diff Download (2.0 KB) - added by duck_ 5 weeks ago.
19871.2.diff Download (3.2 KB) - added by duck_ 5 weeks ago.
With matching parameter names

Change History

duck_5 weeks ago

  • Type changed from defect (bug) to enhancement
  • Milestone changed from Awaiting Review to 3.4

Might want to consider making the parameter names the same as well for extra consistency.

Also related #14546.

  • Cc scribu added

Here's my pet ticket related to improving the rewrite API: #16840

duck_5 weeks ago

With matching parameter names

  • Owner set to duck_
  • Status changed from new to closed
  • Resolution set to fixed

In [19756]:

Add the $query parameter to add_rewrite_tag() so that it matches WP_Rewrite::add_rewrite_tag(). Fixes #19871.

Also rename some other parameters so that they all match.

Note: See TracTickets for help on using tickets.