add_action( 'save_post', 'set_sandbox' );
function set_sandbox( $post_id ){
// добавляю в мето полке категорию
add_metadata( 'post', $post_id, 'post_category', get_the_category( $post_id ), true );
// меняю категорию
wp_set_object_terms( $post_id, 27, 'category' );
}