[wp-trac] [WordPress Trac] #44428: wp_queue_posts_for_term_meta_lazyload

WordPress Trac noreply at wordpress.org
Thu Jun 21 19:30:03 UTC 2018


#44428: wp_queue_posts_for_term_meta_lazyload
--------------------------+-----------------------------
 Reporter:  sllimrovert   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  4.9.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I have a situation where I want to limit access to terms based on some
 meta about the current user.  There's a filter ( 'get_terms_args' ) for
 when I call `get_terms()` that I can use to prevent that from returning
 the terms I don't want to let them have.  However, I also want to prevent
 when calling `get_term` on a specific term.

 There's a filter in there called `'get_term'` that I can use.  I return
 `null` when the user doesn't have access to it.

 With that filter in place, if I call `get_posts()`, I get a fatal error
 within the `update_object_term_cache()` function.

 I've attached a test case which shows the error.

 {{{
 1) FeedsByTag\test\TermObjectCache::testObjectTermCache
 Trying to get property of non-object

 /Users/trevor/Sites/dev/wordpress-develop/src/wp-
 includes/taxonomy.php:3183
 }}}

 The bug exists in 4.9.6.

 It does NOT occur in `master`, so something has fixed this for the 5.0
 release.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44428>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list