WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 2 years ago

#14546 closed enhancement (fixed)

Refactor direct references for $wp_rewrite class members

Reported by: ikailo Owned by: duck_
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: has-patch
Focuses: Cc:

Description

This patch replaces direct references to class members $wp_rewrite->* with their public functions.

Removes:
$wp_rewrite->flush_rules(), $wp_rewrite->add_permastruct(), $wp_rewrite->add_rewrite_tag()

Replaces with:
flush_rewrite_rules(), add_permastruct(), add_rewrite_tag()

Also removes extraneous $wp_rewrite globals.

Follow-Up to #10912

Attachments (2)

refactor_for_wp_rewrite.diff (10.2 KB) - added by ikailo 4 years ago.
14546.diff (8.5 KB) - added by duck_ 2 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 nacin4 years ago

  • Keywords has-patch added; $wp_rewrite removed
  • Milestone changed from Awaiting Review to 3.1

comment:2 markjaquith3 years ago

  • Milestone changed from 3.1 to Future Release

comment:3 duck_2 years ago

  • Keywords needs-refresh added
  • Milestone changed from Future Release to 3.4

Patch needs a refresh and it requires #19871 since it tries to use add_rewrite_tag() with 3 parameters.

duck_2 years ago

comment:4 duck_2 years ago

  • Keywords needs-refresh removed

comment:5 duck_2 years ago

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

In [20023]:

Reduce references to the $wp_rewrite global because it's no longer used or a wrapper function can be used instead. Fixes #14546.#14546.

Note: See TracTickets for help on using tickets.