[wp-trac] [WordPress Trac] #19035: PHP notices caused by assumption about get_queried_object()
WordPress Trac
wp-trac at lists.automattic.com
Mon Oct 24 12:52:16 UTC 2011
#19035: PHP notices caused by assumption about get_queried_object()
--------------------------+-----------------------------
Reporter: johnbillion | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Template | Version: 3.3
Severity: normal | Keywords:
--------------------------+-----------------------------
`post_type_archive_title()` is used in `wp_title()` to produce the title
for post type archives. The function assumes that `get_queried_object()`
will return the post type object for the current post type archive, but
this isn't always the case.
Example: When viewing `example.com/my_post_type/?my_taxonomy=my_term`, the
return value of `get_queried_object()` is the term object, not the post
type object. This causes a PHP notice when `post_type_archive_title()`
attempts to access the label for the post type object, and results in a
blank title.
Not sure where best to fix this.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19035>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list