[wp-trac] [WordPress Trac] #37114: Allow short-circuiting `get_post_class` for performance

WordPress Trac noreply at wordpress.org
Thu Jun 16 12:19:06 UTC 2016


#37114: Allow short-circuiting `get_post_class` for performance
-------------------------------+------------------------------------
 Reporter:  bordoni            |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:  template, performance
-------------------------------+------------------------------------

Comment (by bordoni):

 Hi @swissspidy, so Taylor explained this really well at this article:
 https://taylorlovett.com/2016/05/26/post_class-get_post_class-performance-
 killers-wordpress-woocommerce/

 But to summarize it a little bit, it can be taxing depending on the amount
 of terms you have on a given query for an archive page it can be a
 performance hit.

 On the Escaping, do you think with this kind of Pre Filter we need to
 apply some escaping? It would be basically duplicating some code from the
 function it self. But If you think it's a good idea I don't see a problem.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37114#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list