WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#19871 closed enhancement (fixed)

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

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

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 (2)

19871.diff (2.0 KB) - added by duck_ 6 years ago.
19871.2.diff (3.2 KB) - added by duck_ 6 years ago.
With matching parameter names

Download all attachments as: .zip

Change History (5)

@duck_
6 years ago

#1 @duck_
6 years ago

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

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

Also related #14546.

#2 @scribu
6 years ago

  • Cc scribu added

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

@duck_
6 years ago

With matching parameter names

#3 @duck_
6 years ago

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

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.