I want to retrieve an array with the posts of a certain user for a custom post type category.
However, get_posts($arg) returns ALL posts of this custom post type, although I specified the post_author
<?php $pages = get_posts(array('post_type' => 'profile','post_author' => $post->post_author)); ?>
<?php var_dump ($pages); ?>
In this example $post->post_author is 11. However, the result of the code above is:
array(3) {
[0]=> object(WP_Post)#343 (24) {
["ID"]=> int(2326)
["post_author"]=> string(2) "11"
..etc.}
[1]=> object(WP_Post)#352 (24) {
["ID"]=> int(2324)
["post_author"]=> string(1) "0"
...etc.}
[2]=> object(WP_Post)#395 (24) {
["ID"]=> int(2322)
["post_author"]=> string(1) "0"
...etc.}
Why does get_posts() returns posts of authors whose ID is not 11?