WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 8 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: 1.5.1.1
Component: General Keywords: 404 is_single bg|has-patch bg|dev-feedback
Focuses: Cc:

Description

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 10 years ago.
patch for 1.6 SVN

Download all attachments as: .zip

Change History (6)

comment:1 @ryan10 years ago

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

comment:2 @markjaquith10 years ago

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

@markjaquith10 years ago

patch for 1.6 SVN

comment:3 @markjaquith10 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.

comment:4 @ryan10 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

comment:5 @anonymous8 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.