I’m afraid I don’t understand the question perfectly, so I apologize, but,
$post_status="publish";
Wouldn’t that do it?
I am missing context though, are you building a query? Because to get all the posts by the current user, something like this would be needed:
$args = array(
"post_status" => "publish",
"author" => get_current_user_id(),
"posts_per_page" => 10
);
$query = new WP_Query($args);
//do things with query...
Or are you working with query_posts or pre_get_posts? More context would be helpful here.
Related Posts:
- featuring old articles without messing up with the archive
- Hiding by default specific post status on backend list?
- What differences are there between a Privately Published post and a Draft post?
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- How publish post from pending status
- How to prevent posts from being published too close to each other?
- How to Display a List of Users Who Have Made at Least 1 Post?
- Is it possible to Schedule Attachments in WordPress?
- Let private posts stay in status “private” after edit through “editors”
- Elegant way to include only published posts with get_objects_in_term()?
- WordPress plugin to publish to multiple remote WordPress blogs
- Post publish only hook?
- Publish pending article from front end with a button?
- How to add a “publish” link to the quick actions
- How to limit user to publish post per day and per role?
- When a user creates a post (pending), send a confirmation link that allows them to publish
- In what sequence are the hooks fired when a post is “published”?
- Restrict the Number of Posts an Author can Publish (over time)?
- Setting post meta data to random value during post status transition / on publish
- How to change post status from publish to draft using hook in wordpress?
- Publish posts only after the condition is met
- Enable commenting on front-end preview page for pending posts
- Detect Post Type when publish_post is ran
- How can I display a specific user’s first published post?
- Custom Post Status Posts viewable to the public
- Does WordPress remove draft status automatically?
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- Send email to user that his post has been rejected
- Limit number of posts a user can make per minute?
- How can a guest view the “Pending Review” Post?
- Every possible way to get data (posts) from WordPress
- publish_post conflicts with save_post
- How do I batch create revisions of all posts?
- add filter to “quick edit menu” in wordpress admin
- ‘transition_post_status’ only fires when pressing “Add New”
- Notification to Admin or Author upon new post [duplicate]
- How to run a function when post is edited or updated using publish post action?
- How can I create custom button in post.php
- How to rename “Publish” metabox title in post screen
- Update post status from “publish” to “trash” for half of posts
- count the total number of comments the user has received for his published posts
- How can I set a Post’s default visibility to private and pending review checked
- Automatically Updating Publish Date Bug
- how to remove dash (-) post status from post title on posts listing page wordpress
- How can I schedule a PAGE to go live at a future date/time?
- How to give capability (publish contributors posts) to author role?
- Print a message if excerpt is empty after posts have been publish/update!
- How to change post status from frontend?
- Check if checkbox is marked on publish/update post
- Decide user that can publish a post
- How to switch wordpress post status between publish and schedule in MySQL?
- Posts and Attachments with “Published” status in Search
- Prevent scheduled post being published if date/time is past current date/time
- Calling Different Custom Post Timestamps in a table
- Admin – create custom post status and display above table
- Restrict edit, but allow preview for custom post status
- WordPress capabilities on pending post status
- Copy post to separate database with “add_action(….)”
- Do action on publish or update?
- transition_post_status hook doesn’t have any POST data when publish with Gutenberg [closed]
- How do I manage my users post before publish?
- do more action after I publish a post
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- $post->post_type not working
- how can i allow users to view their own pending posts in a front-end page
- Assign published posts to another user automatically
- Display password protected posts to logged in users
- Stop wordpress from creating empty/null entries
- WordPress bulk category select when publishing post
- How can I tell if a post has been published at least once?
- Send email for pending post
- Post: how to set created date after post has been published [closed]
- Add delay to publish post
- What function publishes a post when you click the publish button?
- Post Status Frontend Announcement
- Publish a Silent Post without updating Feed
- Display amount of pending posts in back/front end
- Show Last Revision Of Post That Has A Published Status On Single Page
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- WordPress doesn’t save or publish new posts
- Updating post status via rest api
- Send email to user when I publish a new post
- My posts are getting to Auto draft when I try to Publish
- How to publish a post if condition is met?
- WordPress get tags in “publish_post” hook
- Hide or remove custom post status
- Put page on Archived statut after end of publication date
- get_next_post() not working with future post status
- post is not showing more than 3949 words
- Bulk Post update_post_meta
- Create blog post from external source and set publication date
- Modify loop to include all post statuses not just ‘published’
- I want to send push notification just after publish a new post
- Function/filter or plugin to change post status based on custom field value
- How to Test a Blog Post for Update vs. Publish Status — Unique
- How to handle a post before publishing?
- get_posts includes “auto drafts”?
- Return All Post from publish to draft [duplicate]
- Post Format Status [closed]
- How can add custom commands in post-new.php in wordpress