[wp-trac] [WordPress Trac] #11435: Notice when requesting post title of non-existent post
WordPress Trac
wp-trac at lists.automattic.com
Mon Dec 14 19:41:45 UTC 2009
#11435: Notice when requesting post title of non-existent post
--------------------------+-------------------------------------------------
Reporter: filosofo | Owner: ryan
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.0
Component: General | Version: 2.9
Severity: normal | Keywords: has-patch get_the_title
--------------------------+-------------------------------------------------
If you try to get the post title using get_the_title(123), where 123 is
''not'' an existing post's ID, you get two notices because get_the_title()
tries to access non-existent properties of NULL.
What exacerbates the problem is that the ID passed to the "the_title"
filter is based on the (non-existent) ID property of the supposed post
object. So filter callbacks can't fully deal with non-existent post title
requests, as they do not get the requested ID.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11435>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list