[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 04:47:19 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:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------
Changes (by adamsilverstein):

 * keywords:   => has-patch


Comment:

 Replying to [comment:4 SergeyBiryukov]:
 > Replying to [comment:3 adamsilverstein]:
 > > i see lots of other spots where coding practice spaces are missing.
 surprised to see that, but maybe doesn't belong in this ticket... going to
 fix and submit separately.
 >
 > Note that formatting cleanup tickets are discouraged. Coding style fixes
 should be a result of more substantial changes:
 http://wpdevel.wordpress.com/2011/03/23/code-refactoring/.

 thanks for pointing that and saving me the effort. i was surprised to see
 the non-standard coding, but realized it was older code.

 still, i found it a useful exercise in self-training to go thru the code
 for that single file (post-template.php) and correct mistakes. i'm trying
 to train myself to see the proper coding style by default (i've been lazy
 too long), and this was good practice, i even had to go back to the coding
 style document a few times to check my assumptions, so i definitely
 learned something.

 i'll keep the diff for myself, but won't bother submitting as a ticket.

 any other comments on the changes in this ticket, and whether adding the
 missing WP_Error return is worthwhile, is it there for some future
 purpose, consistency, or is it just an extra check for a condition that
 will never occur?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23255#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list