Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#1413 closed defect (bug) (fixed)

is_* functions still return true on is_404() pages

Reported by: markjaquith Owned by: ryan
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: 404 is_single bg|has-patch bg|dev-feedback
Focuses: Cc:


If you use is_single(), is_day(), is_month(), is_year() etc in your theme to show/hide things conditionally, the don't work as they should for 404 requests. So if http://site.com/2004/04/02/bad-title does not exist, is_404() will be true, but so will is_single()

If a page is 404, it can't be anything else. Even if it looks like it is formatted like a permalink page, it's not a single page. It's a 404, period. The logic should be changed so that if is_404() is true, every other "is" is false.

Attachments (1)

classes.php.diff (707 bytes) - added by markjaquith 13 years ago.
patch for 1.6 SVN

Download all attachments as: .zip

Change History (6)

#1 @ryan
13 years ago

  • Milestone set to 1.6
  • Owner changed from anonymous to ryan

#2 @markjaquith
13 years ago

  • Keywords bg|needs-patch added
  • Owner changed from ryan to markjaquith
  • Status changed from new to assigned

13 years ago

patch for 1.6 SVN

#3 @markjaquith
13 years ago

  • Keywords bg|has-patch bg|dev-feedback added; bg|needs-patch removed
  • Owner changed from markjaquith to ryan
  • Status changed from assigned to new

Ryan, check out this patch. To be honest, I get kind of lost in classes.php

Make sure I got all the is_* things I should have and don't have any we don't need to reset. Seems to work, from my tests.

#4 @ryan
13 years ago

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

(In [2885]) Clear all other query flags if we have a 404. fixes #1413

#5 @(none)
11 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.