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
- is_singular() in mu-plugins not working
- How can I use WordPress functions in my stylesheet?
- Share buttons on article footer
- How to create a Page alias in WordPress
- Creating search filter through plugin
- WP-Members redirect if member ALREADY logged in
- How to edit/delete single row items in a table on my own menu page
- Is there plugin to show recent posts from one website in the widget area of another?
- Get a list of galleries from an album in NextGEN Gallery [closed]
- Undefined property: WP_Post_Type::$ID
- Plugin exceeds memory limit
- How to trigger $_GET request within admin plugin page?
- Wp favorite posts get user favorites in profile using buddypress [closed]
- Preferred way of cacheing a value in php
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Automatically add attributes to woocommerce product?
- Edit Yoast SEO breadcrumbs output [closed]
- Adding a slider captcha to the comment system
- submit posts by unregistered users in wordpress
- How to put JQuery/Ajax inside shortcode?
- 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]
- WordPress Widget Not Saving Data
- How I can internationalize variables within the function _e () __ (), etc?
- Notify comment author upon reply
- WordPress get_avatar function not correct working
- add_action into another add_action not working
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- How do I publish portfolio items with a future date?
- Add User Role: Pre-saved in User-Meta [SOLVED]
- How to make a dynamic css class whose name changes every visit to confuse scraper
- How WordPress core manage the plugin installation
- Flickering sidebar when scrolling page [closed]
- Shortcode not working – quotes seems strange
- Using custom fields for image alt and title
- How to display registered customer list as dropdown in WooCommerce checkout?
- Where Should i write the code for wordpress ajax voting?
- Post status doesn’t update to ‘future’ every time?
- WP::is_main_query() Not Working
- “Allowed memory size” problem [closed]
- Hook Scripts and Styles in WordPress
- Echo out element to another page.
- WordPress plugin won’t create custom tables
- Trying to get property of non-object wordpress error message
- Problem with ajax plugin for refreshing posts
- Advertising: Every page refresh counts as 3 ad impressions
- WordPress Cache delete on plugin uninstall
- Woo-commerce Update price as a Bulk from My offline software export
- How to disable login in iframe which is hosted in same domain?
- Display Author name PHP (Selfmade Plug-IN)
- Display top level parent category as a single product body class (Woocommerce)
- Allow a particular user to access a particular plugin?
- WordPress Standard Fix Errors
- How do I use a plugin’s shortcode attribute value in another function?
- Change the address of the music player if not available
- update_post_meta is not working for me when I use e.preventDefault for update button
- Use modulo condition in ACF repeater Field
- Add a WooCommerce Product Variant with attributes programmatically
- Site broken by unedited php?
- Help with customising love it plugin (use within foreach)
- Plugin communication between sites that use it?
- Include post_date in search
- What is the process for reimplementing a back up WordPress?
- Showpost and last
- Undefined variable _POST
- How to add custom html to the Media > Attachment Details modal?
- Displaying Category Feature image on loop
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- WordPress broken dashboard with ninja-shell text
- How to show custom post type in all post section?