Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
When I call post with get_post_meta I get all posts.I would like to get related post from user when using get_post_meta. How would I achieve this?
Example: If I am logged in as foo than I would like to get all posts by foo.
Try to use get_posts()
$current_user = get_current_user_id();
$args = array(
'post_type' => 'post',
'author' => $current_user,
'post_status' => 'publish',
$all_posts = get_posts( $args );
Required, but never shown