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 );
Related Posts:
- How to create a clone role in wordpress
- How do I make a draft post accessible to everyone?
- Create custom user role (client) that can create another custom user role (employee) of that client
- Allow roles below admin to add subscribers only
- How to force listing contributors in authors dropdown menu
- Allow authors to edit only certain users
- How do I allow a specific Role in WordPress 3+ to only see certain plugins?
- Allow editors access to added plugins
- Temporarily disable user role login and replace with message
- How to loop through each user id?
- Change role after the user has read all the posts in a category
- Do custom user roles have any default capabilities?
- Filter available WooCommerce payment gateways by role [closed]
- How to programmatically add a user to a role?
- Can i copy administrator role to another user?
- How to change role of all users with a specific role to another role?
- How to make an author archive only for certain user role and show related CPT
- Allow users to publish child pages of the pages they have access to edit
- Is there a way to set the user Role based on email domain
- pre_get_posts Remove posts based on meta value with ‘post__not_in’
- How to prevent users with “edit_others_posts” capability from editing admin posts
- Access on specific pages in wordpress for a specific user
- Change the user role after x days
- Get (echo) all role names assigned to user
- Locking Down WordPress Application Password Permissions / Capabilities
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- How to let someone preview a draft?
- How can I allow user to select minimum privilege smartly
- Remove wordpress author’s capability to moderate comments on their own posts
- Are there individual memory allocations for different user roles in WordPress?
- How to redirect specific post type with user role
- Contributor disable seeing others’ posts
- Prevent Editors from Editing/Deleting Admin Accounts
- Listing child pages depending on user capability (role)
- Membership subscription, change user role when subscription runs out
- How do I display user name, role and site name using HTML tags inside a dashboard notification?
- Change user role after bulk-import
- Show metabox for a special role
- Restrict Access to Posts based on Custom User and Post Meta Data
- User Role Capabilities for WordPress Gutenberg Blocks
- Iframe disappears when author updates page
- How to create user specific pages (not user role!)?
- How to change a user’s role conditionally to expire after two weeks
- Custom capabilities to add, edit, remove users of a particular role only?
- Stop users of author role from editing already pending posts
- Restrict Access in Admin Panel
- Check role of Username then echo something if administrator [closed]
- Force modified contributor role to be re-approved on edit?
- Stop contributors from editing standard posts but allow them to edit a custom post type
- How to hide a HTML element based on user role
- List users of an array of roles
- create new user role for reader
- How to exclude subscriber from the list in wordpress
- Hide Users by user role in Worpress
- Want to know parameters that can be passed to user_can() for access control by user capabilities
- Block user roles from accessing the WordPress dashboard
- Change user role of a particular user at specific time
- Can we hook the Customizer on a post or page on the front of the site?
- Is it proper to build a site supporting blog visitors in WordPress?
- Removing capabilities from cloned admin role
- User role editor – Add download files capability
- Setting an expiration date for wordpress roles
- Could we know who published a post on WordPress?
- Auto Change WordPress Roles
- Error while creating a clone role in wordpress
- Custom Plugin – Blacklist/Whitelist domain email and change user role – Suggestions
- Change auth_cookie_expiration for specific roles and specific login times
- Infinite redirects at front end if logged in user is not an Admin (Toolset Access)
- Set user role, if an specific role created an user
- Block access to plugins.php for custom role
- Allow user to select role from front end edit profile form
- How to hide Add new Term area for taxonomy terms for specific role (Client)
- How to make WP page accessile only to specific user roles
- Remove add post for user role
- Restrict Author to post only to a specific category
- WordPress – Limit custom/specific user role to only have access to edit the contents of an Advanced Custom Fields Pro Options Page
- TCPDF only exports .pdf when user is administrator
- How to allow suscriber to access specific pages in dashboard?
- Enable plugins for a specific user role
- Switch role on submit button
- Custom User Role – can’t edit or publish pages?
- Dropdown of user roles that depend on variable
- Add role selector to custom registration page
- Multiple user role on registration
- Trying to get new role to have edit permissions for custom content type
- Why are all roles assigned to a user when using wp_insert_user()?
- Why does user_can return false for a capability during plugin deactivation?
- Removing Admin Bar Node Based on Role
- Create an email address that forwards to users in role
- How to update user role totals
- Custom user role doesn’t show up in admin
- Welcome email specific to user role
- update_user_meta on registration but only for default role type
- New folder and file permissions are not correct
- How to change user role setting in members plugin so that user can only edit his own post?
- How to assign a custom gender to a user role?
- assign roles to users in custom drop down in signup form
- Hide block of HTML if the users role is a certain role
- How might I enable a user to view Draft pages from a different Author, without the ability to edit?
- Display users by role