Skip to:

Opened 11 years ago

Closed 11 years ago

#2336 closed task (blessed) (fixed)

Use rewrite rules API

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.4 Priority: normal
Severity: normal Version: 2.1
Component: Tools - Code Improvements Keywords: has-patch 2nd-opinion


Right now, we hack in our custom rewrite rules results by merging them in with the WP_Rewrite global values. This works fine enough, but isn't very extensible, and could potentially be fragile in the future.

While I'm working on BuddyPress's rewrite rules API for 1.8, I noticed bbPress could use the same treatment.

Attached patch removes the dependence on hooking into the rewrite rules generation action, and instead uses a series of add_rewrite_rules() and add_permastruct() calls, where appropriate. It also adds a few tertiary functions that were previously omitted.

Attachments (2)

2336.patch (18.0 KB) - added by johnjamesjacoby 11 years ago.
2336.2.patch (17.8 KB) - added by johnjamesjacoby 11 years ago.
Deprecate bbp_generate_rewrite_rules()

Download all attachments as: .zip

Change History (8)

11 years ago

Deprecate bbp_generate_rewrite_rules()

#1 @alex-ye
11 years ago

Nice improvements, I am thinking if this can break the back-compatibility ... I will give it some tests.

#2 @johnjamesjacoby
11 years ago

In 4918:

Add sub-actions for rewrite rules and permastructs. See #2336.

#3 @johnjamesjacoby
11 years ago

In 4926:

Introduce reply archive slug option. See #2336.

#4 @johnjamesjacoby
11 years ago

In 4927:

Introduce paged rewrite ID and slug helper functions. See #2336.

#5 @johnjamesjacoby
11 years ago

In 4929:

Fix @deprecated tag for bbp_generate_rewrite_rules(). See #2336.

#6 @johnjamesjacoby
11 years ago

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

In 4930:

Use WordPress core rewrite API to add rewrite tags, rules, and permalink structures. Replaces the need to merge rewrite rules directly into the $wp_rewrite array on permalink flush. In the future, much of this complexity can be turned into easier to use functions to add new profile pages, etc... Fixes #2336. See #2337.

Note: See TracTickets for help on using tickets.