[wp-trac] [WordPress Trac] #34047: Split up `wp_lazyload_term_meta()`; check `$check` before lazyloading

WordPress Trac noreply at wordpress.org
Mon Sep 28 23:49:19 UTC 2015


#34047: Split up `wp_lazyload_term_meta()`; check `$check` before lazyloading
-------------------------+--------------------
 Reporter:  dlh          |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.4
Component:  Taxonomy     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+--------------------

Comment (by dlh):

 Thanks @boonebgorges. I had some questions and comments about this
 approach, if I'm following it correctly.

 * Every `WP_Query` instance that hooks into `get_term_metadata()` would
 now keep calling `lazyload_term_meta()` during the action, as opposed to
 just the one instance currently. Would that be a performance risk or load
 unrelated meta?

 * You would need the object to remove the action. If I were using
 `get_posts()` or filtering the arguments for a new `WP_Query`, then I
 couldn't affect lazyloading unless I disabled `update_post_term_cache`.
 But maybe the performance gain is worth it?

 * You couldn't call `lazyload_term_meta()` without mimicking the
 `get_term_metadata()` filter arguments. Depending on the construction, it
 also might not be true there are `// No extra queries. Term cache should
 already be primed by 'update_post_term_cache'`.

 * Would you want to `return $check`, not `return`, to avoid potentially
 altering `$check`?

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


More information about the wp-trac mailing list