Make WordPress Core

Opened 10 years ago

Last modified 10 months ago

#14991 new defect (bug)

extra_rules_top should take priority over extra_permastructs

Reported by: prettyboymp Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Rewrite Rules Keywords: has-patch dev-feedback needs-unit-tests
Focuses: Cc:


Since extra_rules_top are specifically added instead of generated like the those from the extra_permastructs which runs through generate_rewrite_ruls(), shouldn't the extra_rules_top take priority in conflicts?

Attachments (3)

14991.diff (874 bytes) - added by prettyboymp 10 years ago.
14991.2.diff (967 bytes) - added by prettyboymp 10 years ago.
made sure top rules stayed first
14991.3.diff (2.0 KB) - added by prettyboymp 9 years ago.

Download all attachments as: .zip

Change History (11)

10 years ago

#1 @scribu
10 years ago

  • Keywords has-patch added

Makes sense.

#2 follow-up: @filosofo
10 years ago

Won't that put the "top" rules last?

#3 in reply to: ↑ 2 @prettyboymp
10 years ago

Replying to filosofo:

Won't that put the "top" rules last?

Good catch. Adding a new patch.

10 years ago

made sure top rules stayed first

#4 @dd32
9 years ago

  • Keywords needs-patch added; has-patch removed

Using array_reverse like that looks like an ugly hack to me, If i'm understanding this correctly, perhaps we can add the permastructs to a separate array, and then merge it after the loop?

Reseting to needs-patch given this will be stale now (I've changed that block)

9 years ago

#5 @prettyboymp
9 years ago

  • Keywords has-patch added; needs-patch removed

Added updated patch. I went with dd32's suggestion of using a separate array for permastructs.

I switched to using the '+' operator instead of array_merge in the final rule merging. I would think this is the effect that was originally desired when this when this was created.

#6 @markjaquith
9 years ago

  • Milestone changed from Awaiting Review to Future Release

#7 @chriscct7
5 years ago

  • Keywords dev-feedback added

Patch is still good to merge, and I like the idea behind this one. Tagging for re-review

#8 @chriscct7
4 years ago

  • Keywords needs-unit-tests added
Note: See TracTickets for help on using tickets.