Make WordPress Core

Opened 15 years ago

Closed 15 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_
Priority: normal Milestone: 3.4
Component: Rewrite Rules Version: 2.1
Severity: normal Keywords: has-patch
Cc: Focuses:

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_ 15 years ago.
19871.2.diff​ (3.2 KB ) - added by duck_ 15 years ago.
With matching parameter names

Download all attachments as: .zip

Change History (5)

@duck_
15 years ago

#1 @duck_
15 years ago

  • Milestone Awaiting Review → 3.4
  • Type defect (bug) → enhancement

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

Also related #14546.

#2 @scribu
15 years ago

  • Cc scribu added

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

@duck_
15 years ago

With matching parameter names

#3 @duck_
15 years ago

  • Owner set to duck_
  • Resolution → fixed
  • Status new → 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.