Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#10912 closed enhancement (fixed)

Complete the rewrite API

Reported by: scribu Owned by: nacin
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9
Component: Permalinks Keywords: has-patch
Focuses: Cc:


Every public method of the WP_Rewrite class should have a standalone function that calls it.

Currently, add_permastruct() and flush_rewrite_rules() are missing.

Attachments (1)

10912.diff (1.2 KB) - added by scribu 6 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 @scribu6 years ago

  • Keywords has-patch added
  • Milestone changed from Future Release to 2.9

Current patch adds the 2 missing functions. Still need to replace all direct $wp_rewrite->* calls.

comment:2 follow-up: @hakre6 years ago

@param $hard bool is not explained. what does true or false mean in terms of the function creation.

comment:3 @ryan6 years ago

  • Summary changed from Complete rewrite API to Complete the rewrite API

comment:4 @ryan6 years ago

I tweaked the summary cause when I see "complete rewrite" I tend to tune out. :-)

@scribu6 years ago

comment:5 in reply to: ↑ 2 @scribu6 years ago

Replying to hakre:

@param $hard bool is not explained. what does true or false mean in terms of the function creation.

Added explanation.

comment:6 @hakre6 years ago

Something that popped in my mind somewhere in the last day(s):

These functions fail if the global $wp_rewrite is either not set or contains the wrong object then the function expects. Checks should be added in those and in all the other global functions that are part of the rewrite API.

This is common in other public function in trunk as far as I remember.

comment:7 @ryan6 years ago

  • Milestone changed from 2.9 to 3.0

comment:8 @nacin6 years ago

  • Owner changed from ryan to nacin
  • Status changed from new to accepted

Seems logical enough to me to add these.

comment:9 @nacin6 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [13438]) Introduce add_permastruct() and flush_rewrite_rules(), wrappers for the corresponding WP_Rewrite methods. Fixes #10912 props scribu

Note: See TracTickets for help on using tickets.