[wp-trac] [WordPress Trac] #22271: get_post_class() does not always apply filter to output

WordPress Trac noreply at wordpress.org
Sat Nov 3 19:27:13 UTC 2012


#22271: get_post_class() does not always apply filter to output
--------------------------+------------------------------
 Reporter:  F J Kaiser    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Template      |     Version:  3.4
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------
Changes (by scribu):

 * keywords:  dev-feedback has-patch => has-patch


Comment:

 Why would you expect a function called `get_post_class()` to work when no
 post is present?

 > It doesn't harm any other callback (or interfere with it).

 Yes, it does: filters that don't expect $post to be null will break.

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


More information about the wp-trac mailing list