Changeset 13224 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-meta-sync.php
- Timestamp:
- 02/20/2024 06:11:47 AM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-meta-sync.php
r13223 r13224 26 26 function sync() { 27 27 $this->sync_downloads(); 28 Manager::clear_memory_heavy_variables(); 29 28 30 $this->sync_ratings(); 31 Manager::clear_memory_heavy_variables(); 32 29 33 $this->update_tested_up_to(); 34 Manager::clear_memory_heavy_variables(); 35 30 36 $this->cleanup_empty_terms(); 31 32 37 Manager::clear_memory_heavy_variables(); 33 38 } … … 202 207 */ 203 208 public function cleanup_empty_terms() { 209 global $wpdb; 210 204 211 $taxonomies = [ 205 212 'plugin_tags', … … 209 216 ]; 210 217 foreach ( $taxonomies as $taxonomy ) { 218 $term_ids = $wpdb->get_col( $wpdb->prepare( 219 "SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = %s AND count = 0", 220 $taxonomy 221 ) ); 222 if ( ! $term_ids ) { 223 continue; 224 } 225 211 226 $terms = get_terms( array( 212 227 'taxonomy' => $taxonomy, 228 'include' => $term_ids, 213 229 'hide_empty' => false, 214 230 'count' => true,
Note: See TracChangeset
for help on using the changeset viewer.