Opened 12 years ago
Closed 12 years ago
#22077 closed defect (bug) (invalid)
attachment_id conditions works like homepage
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4.2 |
Component: | Query | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description
Hi,
in wordpress attachment_id pages
(for example: http://demo.opensourcecms.com/wordpress/?attachment_id=xxx)
the conditions of homepage, both is_front_page and is_home will work on this attachment_id links like on homepage.
Attachments (1)
Change History (4)
#2
@
12 years ago
- Component changed from General to Query
- Keywords reporter-feedback added; 2nd-opinion dev-feedback removed
Could not reproduce the original bug neither in 3.4 nor in 3.5-beta1.
The unconditional absint()
is consistent with the other ones above:
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/query.php#L1441
If attachment_id
is not a numeric value, then it's not a valid attachment page.
Note: See
TracTickets for help on using
tickets.
I don't know if this is the best approach to the problem but I've solved the problem adding condition for the
attachment_id
, it must be a numeric value to be passed toabsint
, otherwise it will return0
and then later on the condition of marking it as a attachment fails.Although might be better to change the condition, I don't know...