| @@ -97,9 +97,9 @@ | ||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | do_action( 'ep_sync_term_on_transition', $term_id ); |
| 100 | 100 | |
| 101 | - $this->sync_queue[ $term_id ] = true; | |
| 101 | + $this->add_to_queue( $term_id ); | |
| 102 | 102 | |
| 103 | 103 | // Find all terms in the hierarchy so we resync those as well |
| 104 | 104 | $term = get_term( $term_id ); |
| 105 | 105 | $children = get_term_children( $term_id, $term->taxonomy ); |
| @@ -116,9 +116,9 @@ | ||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | do_action( 'ep_sync_term_on_transition', $hierarchy_term_id ); |
| 119 | 119 | |
| 120 | - $this->sync_queue[ $hierarchy_term_id ] = true; | |
| 120 | + $this->add_to_queue( $hierarchy_term_id ); | |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
| @@ -155,9 +155,9 @@ | ||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | do_action( 'ep_sync_term_on_transition', $term->term_id ); |
| 158 | 158 | |
| 159 | - $this->sync_queue[ $term->term_id ] = true; | |
| 159 | + $this->add_to_queue( $term->term_id ); | |
| 160 | 160 | |
| 161 | 161 | // Find all terms in the hierarchy so we resync those as well |
| 162 | 162 | $children = get_term_children( $term->term_id, $term->taxonomy ); |
| 163 | 163 | $ancestors = get_ancestors( $term->term_id, $term->taxonomy, 'taxonomy' ); |
| @@ -173,9 +173,9 @@ | ||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | do_action( 'ep_sync_term_on_transition', $hierarchy_term_id ); |
| 176 | 176 | |
| 177 | - $this->sync_queue[ $hierarchy_term_id ] = true; | |
| 177 | + $this->add_to_queue( $hierarchy_term_id ); | |
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
| @@ -190,9 +190,9 @@ | ||
| 190 | 190 | if ( $this->kill_sync() ) { |
| 191 | 191 | return; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - $this->sync_queue[ $term_id ] = true; | |
| 194 | + $this->add_to_queue( $term_id ); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | 198 | * Delete term from ES when deleted in WP |
| @@ -212,9 +212,9 @@ | ||
| 212 | 212 | Indexables::factory()->get( 'term' )->delete( $term_id, false ); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Enqueue sync of children terms in hierchy when deleting parent. Children terms will be reasigned to | |
| 216 | + * Enqueue sync of children terms in hierarchy when deleting parent. Children terms will be reasigned to | |
| 217 | 217 | * a different parent and we want to reflect that change in ElasticSearch |
| 218 | 218 | * |
| 219 | 219 | * @param int $term_id Term ID. |
| 220 | 220 | * @since 3.6.3 |
| @@ -240,9 +240,8 @@ | ||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | do_action( 'ep_sync_term_on_transition', $hierarchy_term_id ); |
| 243 | 243 | |
| 244 | - $this->sync_queue[ $hierarchy_term_id ] = true; | |
| 244 | + $this->add_to_queue( $hierarchy_term_id ); | |
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | - | |
| 248 | 247 | } |