I’m trying to change post categories inside a save_post action callback function, but I get endless recursion, because wp_update_post method fires save_post action itself.
Maybe somebody did this before& Or there is a way to change post categories without using wp_update_post method?
you can pass the new categories to the function, in the same way you add the post.
I think this is a correct answer for wordpress 3.1 + :
https://wordpress.stackexchange.com/a/72351/44018
in this case the loop is not coming 😉