Custom Fields
Re-Envisioned
Support MB Relationships Retrieve relationships with get_posts()? Reply To: Retrieve relationships with get_posts()?

#12727

Farheen
Moderator

Hello Doug

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.

WP_Query Functions