You can use 'publish' === get_post_status( $id )
, where $id
could be the current page ID retrieved via get_the_ID()
or any other.
Related Posts:
- $wpdb-prepare : Do I have to bind a parameter to the table name?
- ACF Pro select field problem [closed]
- SELECT query with prepare and placeholder for string
- Is there a way to select posts and print to a template page dynamically?
- Display the posts in a category with
- MySQL – UPDATE query based on SELECT Query
- How to write a SQL DELETE statement with a SELECT statement in the WHERE clause?
- SQL: Two select statements in one query
- How to Get All Posts with any post status?
- Is it possible to have more “levels” of draft/published statuses?
- Using get_post_meta with new_to_publish
- How to 301 private posts rather than 404?
- WordPress parent select need to be removed
- How do I properly format the user_role array?
- How to Get All Posts but the Private ones?
- Detect type of post status transition
- change a post status when users update posts?
- delete custom post based on custom field date
- update_post_meta() not working when used with WordPress action
- Custom widget using get_categories select menu dropdown
- How do I check if a posts status is set to draft or pending?
- Triple meta_key on custom SELECT query
- How to set default status to custom post type
- How to get a list of taxonomy terms which are being used only within certain post types?
- Export posts manually selected by end user (not logged in)
- add filter to “quick edit menu” in wordpress admin
- Admin menu bar dropdown opens when I click on a form element (Chrome) [closed]
- How to Modify this $wpdb query to accept an array of post statuses
- Can I limit term selection to one plus parent?
- how to save selection meta data in user profile on frontend
- WordPress select field – show current value?
- I have 2 post types i need to show the post type contents in 2 select boxes [closed]
- Is it possible to change an existing post status from ‘pending’ to ‘publish’ via email?
- how to remove dash (-) post status from post title on posts listing page wordpress
- Wp_query Add specific pending posts
- Function to change post status IF current user and post author are the same
- Why is my select meta data not saving?
- Schedule future post to custom post status instead of publish?
- MySQL Rank & $wpdb
- how to do a processing Orders into Complete after x Minutes or x hour in WooCommerce [closed]
- WordPress post_status is future, manually added
- change woocommerce product statut (draft ->publish // publish->draft) depends on the month [closed]
- how to transition to custom post status on post save
- Count posts by type including drafts and pending posts
- Multi-select field for Taxonomy can’t save the value
- Custom post status filter links always show a count of all posts in the site with that status, not the logged in users count
- Multiple Post Status
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- Programmatically change post visibility on save_post action return a 500
- retrieve post details in loop
- How can I specify the post status of an untrashed post?
- Any way to change post/page status when editing page?
- Modify output of wp_dropdown_categories to add term IDs to each option
- Metabox multiple custom post select -> display selected items?
- Get value of selected option in select field in a WordPress form
- Include future posts in tags and in search
- Retrieve select tag custom values from array and display them in current page with wp_query?
- Is there a way getting post fields using `transition_post_status`
- Also show terms that are related to draft and pending posts
- Help me SELECT thumbnail from SQL and use
- Display amount of pending posts in back/front end
- Select From wpdb – Author/User Directory page
- Showing posts for today and future
- Help with a get_categories () drop down menu – I want it to show in heirachial form
- Selecting multiple options onclick
- Manually adding or updating CPT automatically sets post_status of future
- Change user role when user’s first post gets published
- How to return a 410 code for previously published posts now set to draft?
- Database SQL query error
- Elementor: How to design Dropdown Select Box Navigation page like Chegg
- How to make a pagination with dropdown selection?
- show label text of select option rather than its value in cmb2
- Filter multiple dynamic dropdown lists within one form using the Smart Grid-layout extension for Contact Form 7
- Custom product status get filtered on all product list views
- Woocommerce – Remove cart button depending product (post) status
- Update post status from “publish” to “trash” prior to year 2018
- Transition_Post_Status hook not working properly
- How to set different color in a select box due to selection with css
- Put page on Archived statut after end of publication date
- get_next_post() not working with future post status
- Woocommerce add a text field if specific option is selected
- Custom status and permalinks don’t work?
- Implementing Select2 plugin into WordPress
- date archive future posts
- Add category selection to function request
- Include attachments with a custom taxonomy in search
- wordpress option page data from select form is not saving to database
- AJAX with Selectbox Plugins (Select2, Chosen, Selectize)
- WP Query multiple select form – meta_query help
- Query for draft or scheduled post
- Override private status – Enable users to read private posts
- Auto Select Child categories on Multiple Dropdown – Jquery
- Custom Query for searching through custom fields
- Repeatable custom meta select boxes
- Change post status by custom fields
- Output dropdown results into Woocommerce Order details
- Open WordPress Page from selected option dropdown
- Do anything on post_status change [duplicate]
- Change Post status based on custom field date +1 day
- Set post status to draft after validating post meta values in save_post hook