get_results("SELECT ID FROM {$wpdb->posts} WHERE post_type='post' AND post_status='publish' AND post_title REGEXP '[0-9]+, *[0-9]+(-[0-9]+)?\\.?$'"); $feadulta=(int)$wpdb->get_var("SELECT term_id FROM {$wpdb->terms} WHERE name='Feadulta' LIMIT 1"); $changed=0; foreach($rows as $r){ $cats=wp_get_post_categories($r->ID); $new=array_values(array_diff($cats,$multi)); if(count($new)!==count($cats)){ if(!$new)$new=[$feadulta]; wp_set_post_categories($r->ID,$new); $changed++; } } echo "lecturas con Multimedia eliminada: $changed\n";