[wp-trac] [WordPress Trac] #23255: get_post_format() can throw PHP notice and doesn't return WP_Error
WordPress Trac
noreply at wordpress.org
Tue Jan 22 15:40:59 UTC 2013
#23255: get_post_format() can throw PHP notice and doesn't return WP_Error
------------------------------+------------------
Reporter: azaozz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.6
Component: Warnings/Notices | Version:
Severity: normal | Resolution:
Keywords: has-patch |
------------------------------+------------------
Comment (by adamsilverstein):
Replying to [comment:8 nacin]:
> The WP_Error bit appears to be a documentation issue. This function
already has multiple error conditions that return false, and none that
return WP_Error. By suddenly adding return values of WP_Error that already
had scalar return values, we risk fatal errors during usage. Overall, not
a good idea.
we got the not good idea addressing #23198, looking at
[http://core.trac.wordpress.org/browser/trunk/wp-includes/post.php#L804,
set_post_format()] which makes the same call $post = get_post($post); then
immediately checks for empty($post). if you don't think it needs changing
thats fine with me.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23255#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list