Under the premise, that your database entries do get saved correctly and your problem occurs on retrieval only:
If multiple boxes had been selected, the values should live in the database as serialized arrays.
Fortunately, get_post_meta
unserializes them for us, but they are still arrays.
Hence, your conditional should be modified like so:
$program_flags = get_post_meta( $post->ID, 'program_flags', true );
if(
'No-marketing-text' === $program_flags
||
( is_array( $program_flags ) && in_array( 'No-marketing-text', $program_flags ) )
){
// do your thing
}
Related Posts:
- How to make number of blog posts a custom field?
- How to display only one category in a custom post type?
- Show a Category Specific Info Box
- How can i retrive the movies, trailers, news in a single page using search
- Archive Page for Custom Post Type is not Working
- Accessing post->ID outside of the loop for listing child pages
- Animated gif for a thumbs
- Sidebar links for different pages
- Posts vs. Pages
- how to set beforsend option in wordpress ajax methods
- Dynamic carousel on individual posts
- Filter Custom Post Type by Category with Ajax
- Hide wordpress field if data is empty in post!
- Edit custom post type admin menu link
- Deleted category by mistake, all posts now have categorized category. Can i revert that?
- Blog Posts in Custom Menu
- I am unable to publish/update post
- How to display data in archive page?
- Delete post by giving its link
- How to add pagination in between post and comments?
- How to include a post type in the admin/backend?
- Display post category in foreach loop with category link
- Set terms in a custom post
- Get posts of ONE taxonomy term of custom post type
- Why WP_Query(‘showposts=5’) shows only 1 post?
- I want to display custom text widgets for each post in the sidebar?
- Most liked page not displaying posts
- Display posts styled exactly like default posts
- WordPress blog or WordPress website
- How to make classes for posts?
- Using custom post template
- Custom Post Archive Page not working
- Hiding Draft Post In Admin
- Print all the tags from a custom post type Please
- Display multiple custom taxonomy values on single custom post types page?
- Adding custom fields to bbpress reply form
- Move first half of posts to one parent page, second half to the other page
- Adding buttons to Add New Post and Add New Page
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- CPT archive redirects to single post
- Show posts by a custom post author
- Custom loop pagination links not working
- Prevent Delete Attachment by URL or When Submit
- Enable Comments Box On Custom Post Type
- wp-cli post create & media import issues
- How can i limit the number of posts created per category?
- Search results posts_orderby and ID
- Getting Custom Post Loop to display in Bootstrap 3 column grid
- Turn On Comments On Custom Post Types in Directory Theme
- WordPress custom Query for Posts in Category display posts multiple times
- Responsive images with custom image size
- Making a custom Pagination for multi page blog post
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- Editing the default page to show all posts, rather than most recent ones
- Unable to restore from backup – how to obtain old blog posts?
- Automatically add date to the auto generation of post slug
- Permission issue with custom post type – not added to menu – by plugin
- Duplicate Custom Post Type and Taxonomy Slug
- How could I change my Permalink from blog to custom structure? [closed]
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Take a received feedback item, turn it into a post
- Getting value from get_post_custom
- WP Admin register taxonomy and post type performance
- Add a custom meta box in the post options that loads some html code in the header
- Static posts page with home.php
- Custom posts in different columns style
- Calling Different Custom Post Timestamps in a table
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Admin – create custom post status and display above table
- Creating a post from data returned from HTML form
- custom post template file not shown, instead all the time 404.php
- Set Default Category to Username
- How to allow visitors to filter posts by multiple taxonomies
- show custom post type category dropdown sorting result on same page
- List authors with the last post title and order by last post date
- Custom Post Type Rewrite To Include Parent Page(s)
- Thumbnail & Category link aside post
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- How to include my own css in post
- Custom post types related to same custom post type?
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- Dynamically switch template on click
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- Page template is accessing the incorrect posts?
- Is it possible to customize the post according to post format in single.php?
- Customize rel=canonical tag for single blog post
- a little direction on custom post type
- disable Tab post on nav-menus page (Admin)
- Format latest/newest post differently
- Custom taxonomy archive page problem
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Tell WP to use a specific template file in posts
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- relating business and products with custom taxonomy?
- Best Way to Add UnEditable HTML to Posts
- Can’t get full post title if there a spaces in title
- Get post meta retrieving wrong value
- How safe is it to delete old posts edits to save database space?
- Adding a user’s ID behind the tag ref link address