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
- Selecting multiple columns in a Pandas dataframe
- How do I UPDATE from a SELECT in SQL Server?
- SQL SELECT WHERE field contains words
- SQL query to get the employee name and their manager name from the same table
- SQL SELECT WHERE field contains words
- Select objects based on value of variable in object using jq
- SQL SELECT WHERE field contains words
- ORA-01843 not a valid month- Comparing Dates
- SQL update from one Table to another based on a ID match
- MySQL SELECT increment counter
- Best way to do nested case statement logic in SQL Server
- ORA-01830: date format picture ends before converting entire input string / Select sum where date query
- MySQL “Or” Condition
- MySQL – UPDATE query based on SELECT Query
- How to write a SQL DELETE statement with a SELECT statement in the WHERE clause?
- Create a temporary table in a SELECT statement without a separate CREATE TABLE
- SQL: Two select statements in one query
- grant select on view
- SQL conditional SELECT
- MySQL Select Multiple VALUES
- DATEDIFF function in Oracle
- MySQL error: Unknown column in ‘where clause’
- Postgresql column reference “id” is ambiguous
- How to order by column A and then by column B?
- How to Get All Posts with any post status?
- How to check if a user (not current user) is logged in?
- How to use wp_nav_menu to create a select menu dropdown?
- New post status for custom post type
- Contact form 7 select box different value-text than content-text in option [closed]
- How to update page status from publish to draft and draft to publish
- Is it possible to have more “levels” of draft/published statuses?
- How to Display a List of Users Who Have Made at Least 1 Post?
- Turn Off Automatic Trash Deletion?
- wordpress function to change post status [duplicate]
- What is a “protected” post status?
- how to assign a status/mark to post?
- Using get_post_meta with new_to_publish
- Assign a Class to the Current “Tag” for Formatting
- Why doesn’t wp_update_post() update the post_status field?
- Custom column for changing post status via ajax
- register_post_status and show_in_admin_all_list
- Changing post status in one click
- How to change “Draft” string for status of custom post type to “Unavailable”?
- How to correctly submit a search form and display the result in an independent page
- How to display the status of users (online – offline) in archive.php
- Let private posts stay in status “private” after edit through “editors”
- How can I run custom function when post status is changed?
- How to 301 private posts rather than 404?
- WP_Query by post ID doesn’t work if post is in custom post_status
- WP_Post_List_Table::get_views – Have post counts account for filters?
- Restrict a Post Types Post Status
- Custom post status and preview
- Creating/editing custom ‘post-state’
- WordPress parent select need to be removed
- Using arbitrary post status without registering it
- Filtering custom posts with Ajax
- get_terms(); show private posts when logged in
- How to deal with multiple select options using register_setting() theme options
- Get a list of ALL Statuses both registered and built-in
- Tag selector like stackexchange?
- Get all posts from custom post type and insert in select input as metabox
- How to change post status in hook?
- Add a select box to all widgets
- Custom Post Status not showing in Custom Post Type ALL view
- Replacing select2 in admin backend for all selects
- Listing all capabilities in dropdown is returning boolean
- featuring old articles without messing up with the archive
- How to select one major category (or custom taxonomy) for a custom post type?
- Populating meta box with select-list of existing posts, and assigning it to custom post types
- Adding custom post status to visibility in publish meta box
- Bulk Update of Custom Post Type Post Status through SQL
- Setting post meta data to random value during post status transition / on publish
- Show scheduled posts in archive page
- Setting a title on a Custom Post Type that doesn’t support titles
- How do I properly format the user_role array?
- What action is called when drafts are saved?
- How do I limit the status options for bulk/quick edit to only Published and Draft?
- How to Get All Posts but the Private ones?
- Detect type of post status transition
- change a post status when users update posts?
- How to change post status from publish to draft using hook in wordpress?
- How can I style future post?
- 418 header status, I’m a teapot [closed]
- Hiding by default specific post status on backend list?
- Automatically move pending posts after 30 days and, update the post date, when users update the posts
- delete custom post based on custom field date
- Make Selected Mutiselect Items “selected”
- Custom contact form 7 select with custom values [closed]
- Comments Feed & Custom Post Statuses
- Why this plugin doesn’t work with media upload page?
- Changing post status
- update_post_meta() not working when used with WordPress action
- Enable commenting on front-end preview page for pending posts
- Custom widget using get_categories select menu dropdown
- How do I check if a posts status is set to draft or pending?