Use the get_post
(see: get_post reference) to get a post like $post = get_post(1);
and then say: $post->post_status
— EDIT
Or even better use the get_post_status
(see: get_post_status) like $post_status = get_post_status(1);
Related Posts:
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- How To Ignore a Filter On Applying Filter the Content In a Function
- post expire after x days
- Accessing post’s meta data based on user’s click of a post
- How do I “get the next 10 posts after post_id == x”?
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- External RSS feed to WordPress Portfolio
- Redirect to another page using contact form 7? [closed]
- pagination on data fetched using SQL query
- How to delete all trashed item in one-go
- Allowing users to Sign-up > Login > Post articles that need approval
- Creating an admin meta box to save post as pending
- WordPress Stats Plugin: Display Post Views [closed]
- WP Insert Post If user refreshes override new post
- WordPress is redirecting me to homepage
- WordPress hide post from custom post-type on a single page
- How can I see $post object in frontend from functions.php?
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Failed to load resource: the server responded with a status of 500 () post.php
- How to echo a PHP Code After the Content
- Displaying friend’s posts only
- Trending Tags based on post views
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- PHP $_session is not work in wordpress
- Redirect a specific User role not admins automatically to view the post that they just updated
- How can I use WordPress functions in my stylesheet?
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- Share buttons on article footer
- How to create a Page alias in WordPress
- Creating search filter through plugin
- How to edit/delete single row items in a table on my own menu page
- Displaying Gravity Form data on WordPress page [closed]
- How use %like% in sql statement wordpress
- How to trigger $_GET request within admin plugin page?
- Wp favorite posts get user favorites in profile using buddypress [closed]
- add mediaelement.js plugins into WordPress video player control bar
- Preferred way of cacheing a value in php
- Edit Yoast SEO breadcrumbs output [closed]
- Adding a slider captcha to the comment system
- Any built-in function to associate a post to category through a plugin?
- Query all customers/users and check for duplicate information
- WordPress function not being called from jQuery method
- WordPress WPforms customization
- wp_remote_get() returns 403 while file_get_contents() does not
- Where these .js file come to source code?
- How to pull email and name from Flamingo plugin
- Which widget to use for display category post with view more? [closed]
- How I can internationalize variables within the function _e () __ (), etc?
- WordPress Related Plugin – only show when related content
- Don’t publish/update a post when a plugin finds errors in custom fields
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Plugin onclick button activate other plugin
- Why does this code snippet create a critical error on my site? [closed]
- Moving FB comments at the end of page
- WordPress custom post type image in RSS
- Next Previous Post in wordpress with previous / next link with title?
- WordPress truncate posts question (plugin related)
- WordPress Post HTML after Posting
- Settings options not showing up on Sub Menu page in WordPress plugin
- Cannot Access Console
- Plugin error after installation
- woocommerce remove coupon link does not work
- Use a hook or filter, or overwrite this Gamipress function?
- How to insert datas in the table on wordpress?
- The Build menu theme is frozen with the wordpress theme
- Does anyone know why my SEO and title become one?
- How to translate to spanish wordpress hardcoded content/files?
- How to get a post views count using ‘WordPress popular posts’ plugin
- Get Shortcode output to database for static post_content
- Show post object of any page in frontend
- strtotime not working
- How To Toggle User_Meta in frontend in a form using PHP
- Change Woo Custom Endpoint Titles from a Plugin
- Optimized PHP & WordPress settings for speed/performance?
- Speeding up WordPress on a Local Network
- How can I store user preferences in WordPress and retreive them later?
- How can I get the Post ID and Post Type within a Must Use Plugin?
- Any method to make specific widget for every post and page?
- How to add php plugin code in theme
- how change my menu on submenu
- Plugin debugging with errors in activation routine
- Embed Javascript code to registered users only
- WordPress Dashboard organize posts based on categories
- Find all strings between an enclosing shortcode
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- W3 Total Cache Can’t Really Detect Things
- Related posts popup
- Get page type to display content
- Insert data in custom table during new post creation
- Capturing POST data
- How do I add php to all links automatically?
- Notification When Post Approved
- Meta Box plugin image_advanced not showing up on frontend
- Creating Features List in WordPress Post
- How to hide home title on pages and posts?
- PHP Creating a formula from mysql db values and db stored math operator
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- How to change all the urls of the WordPress site?
- How do I remove the filter from the orders and add custom status in Dokan?
- How to make a Template page to show the information of different things Shop and Product page?