'getting Trying to get property 'count' of non-object after wp_delete_object_term_relationships
I'm trying to delete a term from a post. I have tried different approaches, and all work:
wp_delete_object_term_relationships($post_id, 'tax_name');
wp_set_post_terms($post_id, null, 'tax_name');
wp_set_post_terms($post_id, '', 'tax_name' )
It is a custom post type and it all looks great. Also the database shows the right values.
But when I call the detail page of any of the posts from that post type, it shows this notice:
Notice: Trying to get property 'count' of non-object in \wp-includes\class-wp-term-query.php on line 806
I have checked the code as far as possible. The results of the queries are all okay. So I really have no idea where that notice come from. Any ideas how to trace this one?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
