I think that you are looking for the function get_post_status
Example:
if (get_post_status($postid)=='publish')
echo date_i18n( $date_format, strtotime( $expiration_date ) );
Related Posts:
- Can I exclude a post by meta key using pre_get_posts function?
- Show Custom Fields in Quick Edit
- Validating Custom Meta Box Values & Required Fields
- SQL Query to copy value of a meta_key into another meta_key
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Custom field metabox not showing in back-end
- Save custom user meta on registration
- How to hide meta box values from custom fields list?
- Added 20 Custom Fields. Only 10 showing in drop down
- Extend WP Customizer to make multiple image selection possible
- How do I order by multiple custom fields using wp_query?
- How to add dynamically the main parent pages’s custom fields and their values to all sub-pages?
- Front-end update_post_meta with ajax
- Why does this Quick Edit checkbox save the value only when unchecked?
- Show posts on a Google Map
- Auto-add paragraphs to custom field?
- Change the RSS Publication Date to use a value from a custom field
- Compare WP Custom Field date
- Leader board for game on homepage
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- Count how many posts have a custom field set
- Update posts after populating ACF field value [closed]
- Adding custom fields (post meta) before/during wp_insert_post()
- Custom field as meta description
- post meta getting deleted on save
- Display WP-Types custom fields in post [closed]
- global function to apply filter to custom field
- How to add a new meta key and assign timestamp to posts
- Print custom field in Query Loop block
- Read / Watch / Listen times – meta
- Login WP – Connect single field to an external api
- Is there a simpler version of WP Media?
- Order RSS content by an advanced custom field value
- Advanced search by two criteria – sort by location and date (ascending or descending)
- Displaying multiple URLs as custom field values
- Collect user custom field in product page woocommerce
- How can I save custom meta to one global value?
- get posts where a custom field contains a text
- Displaying a custom field
- meta fields for the whole wordpress site
- Advanced Custom Fields functionality without plugin
- 3.8 Media Upload and Custom Meta Box
- Let’s Create Custom Field Template Documentation
- WordPress Settings API Repeatable fields
- WordPress creates new lines in postmeta table on post update
- How to add custom filed value after in wp post title
- User customising position of WordPress Featured Image
- Accessing Custom Fields on Pages
- Insert image into sub-field with update_post_meta
- How to Pass values to Custom Field through PHP in WordPress Posts?
- How to use conditional statement with custom field
- Custom field php
- Display a different image for each page with editor
- SQL: Select wordpress posts with given text string and add a custom field to them?
- how to add product subscription field in woocommerce plugin
- How can I change the publish date based on a custom field?
- WP_query multiple custom fields not working
- Editing custom fields for comments
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Getting and calculating averge value of custom fields of the same tag
- Only admin should be able to add a particular custom field
- Automatically Add Custom Fields Value as Tags
- Custom date column in user table not sorting correcting
- pass custom value from single.php to another file via get
- How to speed up post list slowed by update_meta_cache()?
- Custom Fields displaying in single line
- How do i call up default post title in custom posts
- Custom Field URL + description
- How to save multiple custom user profile fields using repeater JQuery
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Retrive acf fields in publish_post action for wp_mail
- Issue on Creating Checkbox Field On Custom Post type
- Update custom field on page specific to logged in user
- Get link picker custom field to show only if field exists
- Save input form on custom field
- Admin – Search Events by a custom field
- create a custom field that let me include other posts
- Check if value exists before saving
- Populate a select box with data stored in the database?
- Change path to child of page when uploading image via custom field
- How can I hide my section title if there is no data in custom fields?
- wp_postmeta are updated for only one page
- Meta Box Data added to header redirect
- How to add a prefix to existing custom fields over MYSQL query?
- Complex WP_Query Using Post Date And Post Meta
- Upload image to wordpress
- I want to add a custom field in the rss title of each post, but don’t want it to be shown on the site
- Custom metaboxes not saving after switching themes
- Custom fields with square brackets in the name
- Custom fields driven site. I want to make a visual editor driven page template. How?
- Dynamically create check boxes for given post titles in WPAlchemy
- Assign custom fields to multiple posts?
- Get fields from metabox array
- Including inline Custom Fields info with add_filter in functions.php
- how to have custom post template including custom write panels for the users to post
- Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]
- price calculation from custom field (woocommerce) [closed]
- Cannot save values to custom fields for variations on Woocommerce 2.4.6
- How I can change PayPal IPN ‘custom’ field in woocommerce?
- Archive for custom fields?