Title: Plugin doesn&#8217;t clear object cache on update.
Last modified: March 2, 2018

---

# Plugin doesn’t clear object cache on update.

 *  [Scott Cariss](https://wordpress.org/support/users/l3rady/)
 * (@l3rady)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-clear-object-cache-on-update/)
 * Hi,
 * When using wordpress with an object cache, this plugin appears to not update 
   the order when you refresh the page.
 * While the plugin does write the update directly to the terms table with a $wpdb-
   >update it doesn’t clear any cache that WordPress may have. So when you refresh
   the page the terms still appear in their old configuration.
 * Your plugin just needs to call a cache clear using the function `clean_term_cache()`.
 * From line 178 in taxonomy-terms-order.php change to:
 *     ```
                           if (is_array($items) && count($items) > 0) {
                               foreach ($items as $item_key => $term_id) {
                                   $wpdb->update($wpdb->terms, array('term_order' => ($item_key + 1)),
                                       array('term_id' => $term_id));
                               }
                               clean_term_cache($items);
                           }
       ```
   
 * will fix the caching issue.
 * Please implement this fix in the next version. Thanks

The topic ‘Plugin doesn’t clear object cache on update.’ is closed to new replies.

 * ![](https://ps.w.org/taxonomy-terms-order/assets/icon-256x256.png?rev=1564412)
 * [Category Order and Taxonomy Terms Order](https://wordpress.org/plugins/taxonomy-terms-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/taxonomy-terms-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/taxonomy-terms-order/)
 * [Active Topics](https://wordpress.org/support/plugin/taxonomy-terms-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/taxonomy-terms-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/taxonomy-terms-order/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Scott Cariss](https://wordpress.org/support/users/l3rady/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/plugin-doesnt-clear-object-cache-on-update/)
 * Status: not resolved