WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#12857 closed defect (bug) (fixed)

Bug with WP class and custom taxonomy/post type

Reported by: momo360modena Owned by: ryan
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Query Keywords: has-patch needs-testing
Focuses: Cc:

Description

During the parse_request function, WordPress check the query if post_type and taxonomy are loaded.

But currently, WordPress verify with the taxonomy->name and the post_type->name instead the query_var.

And as the query_var and the name can be different...

Attachments (1)

classes.php.patch (1.6 KB) - added by momo360modena 4 years ago.

Download all attachments as: .zip

Change History (6)

momo360modena4 years ago

comment:1 dd324 years ago

That code block doesnt seem like it'd be required to me. WP_Query should be handling it all (And i believe it is).

comment:2 scribu4 years ago

marked #13076 as dup.

comment:3 dd324 years ago

Theres another bug related to this, If you have a post_type and a taxonomy of the same name, they'll receive the same rewrite token, resulting in broken rewrite rules for one or the other.

comment:4 chrisscott4 years ago

The patch in #13076 from prettyboymp works for the original bug. I tried removing the code block as dd32 suggested and that didn't fix it--both the entire block at line 276 and the block at line 278 (as of r14241).

Can that patch be committed since this is a regression from 2.9?

comment:5 ryan4 years ago

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

(In [14246]) Fix custom tax and post type query var checks. Props prettyboymp. fixes #12857 #13076

Note: See TracTickets for help on using tickets.