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

WordPress Trac noreply at wordpress.org
Mon Nov 5 18:26:19 UTC 2012


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

Comment (by scribu):

 There is no strong argument for always applying the filter in this case,
 but there is an argument for keeping it the way it is, namely back-compat:

 > get_post_class() does not pass post object, only ID. Any filter will
 have to retrieve post object anyway...

 That's fair, but how do they retrieve the object? By calling get_post(),
 which will return false.

 > and as for me it's filter's problem if it doesn't check that if that
 came up with something.

 Yes, it would be the callback's problem, ''if'' we always applied the
 filter from the beginning.

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


More information about the wp-trac mailing list