Query loop filtering by logged in user

@jayroncastro

It’s now super easy with version 1.9.1 onwards using the query editor. Here’s how I just did mine

$current_user = wp_get_current_user();

return [
‘post_type’ => ‘ENTER__POST_TYPE_NAME_HERE’,
‘author’ => $current_user->ID,
‘posts_per_page’ => -1
];

You will enter this in the Query editor (PHP) block.

I hope this helps.

2 Likes