| | |
| | | <?php |
| | | namespace JVBase\managers; |
| | | |
| | | use JVBase\JVB; |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\managers\Cache; |
| | | use WP_Error; |
| | | use WP_Post; |
| | | |
| | |
| | | { |
| | | global $wpdb; |
| | | $this->table_name = $wpdb->prefix . BASE.'taxonomy_relationships'; |
| | | $this->cache = CacheManager::for('term_relationship', WEEK_IN_SECONDS); |
| | | $this->cache = Cache::for('term_relationship', WEEK_IN_SECONDS); |
| | | |
| | | // Ensure the table exists |
| | | // $this->create_table_if_not_exists(); |
| | |
| | | if (in_array($post_type, jvbIgnoredPostTypes())) { |
| | | return; |
| | | } |
| | | $this->cache->invalidate(); |
| | | // Get all taxonomies for this post type |
| | | $taxonomies = get_object_taxonomies($post_type); |
| | | |
| | |
| | | */ |
| | | public function rebuildAllRelationships():bool |
| | | { |
| | | $this->cache->invalidate(); |
| | | $this->cache->flush(); |
| | | global $wpdb; |
| | | |
| | | // Clear existing relationships |
| | |
| | | ] |
| | | ); |
| | | |
| | | $this->cache->invalidate(); |
| | | $this->cache->flush(); |
| | | |
| | | return true; |
| | | } |
| | |
| | | $term_id, |
| | | $term_id |
| | | )); |
| | | $this->cache->invalidate(); |
| | | } |
| | | } |