$args
are the same tho.
get_posts
is a function that will return an array, when WP_Query
is a class which will be used with the loop
related functions.
Source:
- https://wordpress.stackexchange.com/questions/1753/when-should-you-use-wp-query-vs-query-posts-vs-get-posts#answer-1755
- https://developer.wordpress.org/reference/classes/wp_query/#parameters