| | |
| | | |
| | | use Exception; |
| | | use JVBase\Instance; |
| | | use JVBase\managers\queue\Queue; |
| | | use WP_Error; |
| | | use WP_Post; |
| | | use WP_Query; |
| | |
| | | add_filter(BASE.'handle_bulk_operation', [$this, 'processOperation'], 10, 3); |
| | | } |
| | | |
| | | |
| | | // Update relationships for a post |
| | | |
| | | /** |
| | | * @param int $post_id |
| | | * |
| | | * @return void |
| | | */ |
| | | /** |
| | | * Update relationships for a post |
| | | * @param int $post_id |
| | | * @param WP_Post $post |
| | | * @return void |
| | | */ |
| | | public function updatePostRelationships(int $post_id, WP_Post $post):void |
| | | { |
| | | // Skip autosaves and revisions |
| | |
| | | { |
| | | |
| | | $term_posts = $this->cache->remember( |
| | | $this->cache->generateKey(['id' => $term_id, 'taxonomy' => $taxonomy]), |
| | | ['id' => $term_id, 'taxonomy' => $taxonomy], |
| | | function () use ($term_id, $taxonomy) { |
| | | global $wpdb; |
| | | return $wpdb->get_col($wpdb->prepare( |
| | |
| | | |
| | | |
| | | $related_term_posts = $this->cache->remember( |
| | | $this->cache->generateKey(['id' => $related_term_id, 'taxonomy' => $related_taxonomy]), |
| | | ['id' => $related_term_id, 'taxonomy' => $related_taxonomy], |
| | | function () use($related_term_id, $related_taxonomy) { |
| | | global $wpdb; |
| | | return $wpdb->get_col($wpdb->prepare( |