I’d say your third option is the way to go.
Incidentally, why did you roll your own static cache in taxonomy_image_plugin_get_associations()
instead of using the built-in WP_Cache API for that? Is there a reason wp_cache_get
wouldn’t work here? Seems like using the WP object cache would optimize better when people do have caching plugins turned on.
Related Posts:
- tax_query in get_posts() not working?
- Display Post by taxonomy and taxonomy child
- orphaned taxonomy terms remove by sql query
- Show only, when taxonomy has posts?
- Custom WP Query: force entry for some taxonomy and have others optional
- Get posts by name and taxonomy term
- Using get_posts() with tax_query parameter set isn’t working with attachments
- Modify the query method when adding category filtering function to the custom post list
- Exclude posts with taxonomy term from appearing on home page query
- Syntax help needed: Taxonomy Query
- How can I query all post with currrent taxonomy term?
- Retrieve all term IDs of post
- Exclude taxonomy Query if post_type
- Query Two Different Taxonomies Nested
- Including taxonomy in searches
- What is this Query? and why its taking too much time? Any way to optimize it?
- $product->ID in has_term() not working, but manually inputting the ID works, why?
- How to get a query odered by N of matching taxonomies?
- How to filter the terms to a special custom taxonomy?
- How do I add tags/taxonomy to images + a query field on page to query ‘albums’ (images with same tag/taxonomy)
- Passing values by form to create a query
- Operator ‘AND’ in the get_posts() function’s tax_query terms not working
- When should you use WP_Query vs query_posts() vs get_posts()?
- How to show a hierarchical terms list?
- Get Posts Under Custom Taxonomy
- The Difference Between Hierarchical and Non-Hierarchical Taxonomies?
- How to perform unit testing on proposed patches in Trac?
- Attaching taxonomy data to post with wp_insert_post
- Need a simple but complete example of adding metabox to taxonomy
- How to get taxonomy term of the current page and populate queries in the template
- Can the default “post tags” taxonomy be renamed?
- Custom columns for taxonomy list table
- Custom Taxonomy WP_Query for All Terms in a Taxonomy?
- Custom taxonomy list page?
- How to add a default item to a custom taxonomy?
- Get the ID of the latest post
- Remove the category/taxonomy description field?
- WP_Query vs get_posts
- Add ‘Description’ to taxonomy ‘Quick Edit’
- Why does get_term() require taxonomy? Are term_ids not unique?
- How does Woocommerce store variation attributes, and how can they be retrieved per-variation? [closed]
- What is wp_insert_term “alias_of” arg for?
- Automatically Assign Parent Terms When A Child Term is Selected
- Using get_posts vs. WP_Query
- get term by id without taxonomy
- Using pre_get_posts to set posts per page, how do I?
- get a specific taxonomy term name
- wp_set_object_terms() Fails to Set Terms
- wp_set_object_terms() — prevent overwrite?
- Taxonomy terms sort by… Last name!
- List Hierarchical Term List with Count with Related Term
- How to know if get_posts() failed?
- Is there a way to set singular/plural labels for taxonomy term names?
- WordPress – Creating multiple versions of the same single-customtype.php depending on selected taxonomy categories
- Better way to enforce category hierarchy in post_categories_metabox?
- get_terms() How many is TOO many?
- Exclude custom taxonomy from search results and archive pages
- Child Terms not Displaying on the Taxonomy Term Admin Screen
- get_terms with posts that have a different taxonomy with term x
- How to display child term of current term’s parent taxonomy?
- List all taxonomy terms / Show links if posts are attached, else names
- Get posts by meta data OR title
- List taxonomy terms as links
- check if tag exists in wp database
- Sorting custom taxonomy causes menus error
- How to overwrite a specific parameter in a core taxonomy?
- Set a cookie in WordPress, using a select form and Jquery
- How to add terms to taxonomy with wp_insert_terms?
- How to update taxonomy custom field with wp_update_term()?
- Duplicate Queries
- Get_term_by only returns one item from array
- Very slow query
- How to set a Preset category for custom post types?
- How to find objects by terms
- Can we have same term slug in different taxonomies?
- Is there any difference between post in child term and child & parent terms?
- Add additional data to a specific taxonomy term when used in a post
- Set default (auto) slug prefix for Tags
- How to have “the most used tags” taxonomy always expanded?
- Add Thumbnail to wp_list_categories()
- Get parent and first child taxonomy terms?
- How to add automatically keyword to taxonomies when a post published, and assign them to the post
- Display the number of published posts for each custom taxonomy term?
- Limit number of pages in pagination
- Query multiple taxonomy in Custom Post Type
- Display Custom Taxonomy in Sidebar in Two Columns
- Get wordpress taxonomy archive and sort by year
- Transient not working for custom loops
- Search for tags
- Create and move terms for taxonomies
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Get the most popular terms for a custom post type
- Display Post by taxonomy and taxonomy child if exist
- Fatal error: Call to undefined method stdClass::filter() in wp-includes\taxonomy.php on line 805
- WP native tag suggest metabox. How does it process tag id?
- Missing term_id and term_taxonomy_id when adding a term using wp_insert_term() function
- Update all posts at once
- Change order of WordPress tag cloud
- Retrieve taxonomy terms in order of their post’s date?
- How to get the last term from taxonomy?