Normally, posts are published by the wp_insert_post()
function. Essentially, the post_status
is changed from draft to publish. Nothing more to it than that, really.
There is also the wp_publish_post()
function, which is really only used for scheduled posts. It does the basic job of transitioning a post from “future” to “publish”, and also calls the same various action hooks that wp_insert_post()
would normally call, so that plugins and other functions which take actions on publishing of posts behave correctly.
Related Posts:
- How to Display a List of Users Who Have Made at Least 1 Post?
- Let private posts stay in status “private” after edit through “editors”
- featuring old articles without messing up with the archive
- 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?
- Hiding by default specific post status on backend list?
- Enable commenting on front-end preview page for pending posts
- Custom Post Status Posts viewable to the public
- How can a guest view the “Pending Review” 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”
- What differences are there between a Privately Published post and a Draft post?
- Update post status from “publish” to “trash” for half of posts
- How can I set a Post’s default visibility to private and pending review checked
- how to remove dash (-) post status from post title on posts listing page wordpress
- How to change post status from frontend?
- Posts and Attachments with “Published” status in Search
- Admin – create custom post status and display above table
- Restrict edit, but allow preview for custom post status
- WordPress capabilities on pending post status
- 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
- Is there a way getting post fields using `transition_post_status`
- Post Status Frontend Announcement
- Display amount of pending posts in back/front end
- Showing posts for today and future
- 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
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- Updating post status via rest api
- How publish post from pending status
- 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
- Modify loop to include all post statuses not just ‘published’
- Function/filter or plugin to change post status based on custom field value
- get_posts includes “auto drafts”?
- I am creating a front end dashboard where I need to show all the posts by the current user. So, I need to show posts in publish
- Post Format Status [closed]
- Do anything on post_status change [duplicate]
- editPost without undo entry
- REST API – Retrieving posts with custom status
- Implementing Soft Delete for Bulk Actions / Empty Trash
- How to restore post to pending status (no draft)
- Get WordPress post content by post id
- Get page ID of page that is set as the posts page
- Get Posts Under Custom Taxonomy
- How to limit the number of posts that WP_Query gets?
- Stop WordPress Wrapping Images In A “P” Tag
- When is the ‘post_content_filtered’ column in database cleared by WordPress?
- Turn a URL into an Attachment / Post ID
- GET the excerpt by ID
- Stop WordPress automatically adding tags to post content
- Determine if page is the Posts Page
- How to get ‘post_content’ without stripping tags?
- How to add an admin notice upon post save/update
- Print Current Post Index number within Loop
- Should we trust the post globals?
- Optimize post insert and delete for bulk operations?
- Get the Current Page Number
- How do you add thumbnail support for custom post types?
- How to mark every 3rd post
- Change Posts per page count
- Keep featured content post in homepage with original order
- How to display related posts from same category?
- Can posts have parents?
- Is there a action hook for the “Empty Trash” button?
- How to end the excerpt with a sentence rather than a word?
- How do I check if I linked to a post before I delete it?
- How to change the case of all post titles to “Title Case”
- Appending content with broken in 4.4
- How to get posts published between a date and today?
- ZIP up all images displayed in a [gallery] and offer as download link
- How to detect single.php (but not single-portfolio.php)?
- How to check if post meta key exists or not in wordpress database
- How to remove a column from the Posts page
- removing inline styles from wp-caption div
- What is the use of to_ping and pinged column?
- How to use “Add link” pop up for a WordPress widget
- Remove Categories / Tags From Admin Menu
- How to retrieve text only from wp_content() not from wp_excerpt()?
- Stop WP from creating “Sample Page” and “Hello World!” post
- Where is the old post permalink slug stored?
- How to Create Editable Blocks of Text for the Homepage?
- Keyboard shortcut for updating a page or post?
- Add custom Attachment Display Setting for images
- Rewriting post slug before post save
- Apply the_title() filter in post & page title, but not in menu title
- How to Change Order of Posts in Admin?
- is it possible to get next_post_link
- Get post content by ID
- How to get post creation date?
- Update post counts (published, draft, unattached) in admin interface
- Function to execute when a post is moved to trash .
- How to get post ID of the current page/post inside a widget?
- add action only on post publish – not update
- How to display by default only published posts/pages in the admin area?
- How do you add Read more … link to posts?