Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#28941 closed defect (bug) (invalid)

CPT slug crashes a query because it has the word 'for' in it?

Reported by: perthmetro's profile perthmetro Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.1
Component: General Keywords:
Focuses: Cc:

Description

See my WP support forum post below

http://wordpress.org/support/topic/cpt-slug-crashing-my-template-because-it-has-the-word-for-in-it?replies=1

Basically, in the code i provided if the word "for" is part of a CPT slug and separated by hyphens (property-for-sale) then the word "for" is picked up as php code and screws up the query. Notepad++ also picks it up as php.

I know very little about php but I think i'm on to something here.

Change History (2)

#1 @perthmetro
10 years ago

it is fixed if the slug is bracketed by a '

e.g.
'post_type' => property-something-sale, works ?why

'post_type' => property-for-sale, crashes

'post_type' => 'property-for-sale', works

Last edited 10 years ago by perthmetro (previous) (diff)

#2 @helen
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

I've responded to your forum post. This is not a WordPress bug.

Note: See TracTickets for help on using tickets.