Is it possible to use get_posts() to retrieve relationships instead of WP_Query()? Does the relationship argument need to be modified in some way?
I’m running into an issue where either WP_Query() or wp_reset_postdata() is causing problems with other functionality. So I tried switching WP_Query() to get_posts() using the same arguments, but I get an empty array when I do that.
It is not possible to retrieve relationships with get_posts() due to restrictions
get_posts() is very similar in usage and accepts the same arguments (with some nuances, like different defaults), but returns an array of posts, doesn't modify global variables and is safe to use anywhere.
WP_Query is the class that powers both behind the scenes, but you can also create and work with your own instance of it. A bit more complex, fewer restrictions, also safe to use anywhere.