Can I, instead of doing this via PHP, combine this in 1 sql statement?
object_ids = "select object_id from `wp_term_relationships` where `term_taxonomy_id` = 14;";
foreach(object_ids as object_id)
{
"insert into `wp_term_relationships` VALUES (" . object_id . ",1597,0);";
}
(for WordPress: for every post that has a category (14) add a new term relationship (1597))
1 Answer