i suggest you check the the value of $checkbox by either checking checkbox under meta_key column in wp_postmeta or *your prefix_postmeta table in your database or simply do var_dump($checkbox); for testing if its 0 or null or an empty string or so then your if condition will not return true and $has_video will not be assigned to ‘icon-has_video’.
Related Posts:
- Saving multiple custom meta box fields
- What is the index [0] for on post meta fields?
- Custom field metabox not showing in back-end
- How to hide meta box values from custom fields list?
- Create meta boxes that don’t show in custom fields
- How to break meta values into different items and avoid duplicates?
- Custom fields to save multiple values
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- How to wrap meta values seperated by comma in ? [closed]
- How to create a Custom Meta Box with Name/Value Admin User Input Fields?
- Create Multiple File Upload Metabox in WordPress
- Run a check for multiple meta key values
- Button inside Custom Meta Box triggering the Update Button
- Why is my Custom Meta Box Field Inputs NOT saving?
- get_posts in meta box dropdown not showing latest posts
- How can you include custom post meta in search without calling each key?
- Display Custom Meta Box Field Only If Value is Present
- shortcode in a custom metabox
- Problem with saving large amount of data in postmeta/usermeta
- Move Title and the Content WYSIWYG editor position
- How to validate select field in post meta?
- IF Custom field value equals ZERO
- How to use media upload on metabox post page without breaking TinyMCE?
- Let’s Create Custom Field Template Documentation
- How add multiple wp_editor_box to new post
- Update post meta custom field using block editor
- Can I save post meta programatically without setting metaboxes?
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If metabox has content display content
- put saved metabox values back into fields and then display on the front end
- Add a class to post_class if more than one post shares same meta_value_num
- Show array of meta_value in Edit Post Coloum
- How to improve my non-unique metadata MySQL entries?
- WordPress Blocks, setAttributes not saving
- Allow HTML in Custom Metabox area
- Custom field metabox not showing in back-end
- Save, update, get and sanitize post meta as HTML not plain
- Create Meta boxes dynamically
- Get meta value when the page is a blog archive
- Can’t save meta field value if the title not set
- Display Data From This Custom Media Upload Meta Box?
- When post is updated, custom metadata in text area field is overwritten
- wp_postmeta are updated for only one page
- Custom Field: Display only if a specific key is selected outside the loop
- When editing a post with a custom meta box the values aren’t displaying correctly
- How to add new Metadata options (Date, Author, etc.) for Posts?
- WP Query Args – search by meta_key or title
- get Custom field label (select/dropdown) on front end
- Block Editor – Meta values not saved, meta changes to empty array on update
- Best way to programmatically remove a category/term from a post
- How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
- display specific custom fields
- Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post
- Transients vs CRON +Custom Fields: Caching Data Per Post
- Unable to save datetime custom meta field using update_post_meta() function
- Create custom field on post draft or publish?
- get_post_meta fields don’t show up on posts page
- Add a post meta key and value only if it does not exist on the post
- Adding a custom field or metabox to the post-thumbnail widget?
- Function to change meta value in database for each post
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Get aggregate list of all custom fields for entire blog
- Woocommerce with metabox plugin
- trim custom field text value and show (…)
- using multiple meta_key and meta_value in query_posts
- MySQL Query that looks for post with Custom Field, then changes Category
- How Meta Data is different from Custom Fields of POST/PAGE in WordPress
- Tweak Meta for Post to work it for Pages also
- How to add a new meta key and assign timestamp to posts
- Read / Watch / Listen times – meta
- Custom Meta Box (SELECT) Not Saving
- Displaying multiple URLs as custom field values
- Limits, not all post are showen when querying for posts by view count
- Find a way to retrive data updated through metabox plugin to web page
- Looping inside block return
- Scripts and tags will not save or output from my custom meta box
- Sortable Custom Columns not sorting correct
- Using WP Color Picker in Repeatable Fields
- MetaBox not saving after empty
- How do I save Multiple fields in a meta box?
- Best way to achieve multiple links in a post title
- How to display data from custom fields I created?
- Custom Field & Gravity Forms [closed]
- custom filed from post in the side bar
- Working with multiple values and metaboxes
- Move the metaboxes to the very top of post editor
- How to speed up post list slowed by update_meta_cache()?
- non-unique #_ajax_nonce id in browser console
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Issue on Creating Checkbox Field On Custom Post type
- Why does this javascript search function in the WordPress Admin not work?
- 4 Unique Random Posts based on Custom Field Values
- Save input form on custom field
- Check if value exists before saving
- Meta Box Data added to header redirect
- Custom metaboxes not saving after switching themes
- Get fields from metabox array
- Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]
- Dynamic background image used in css after selector
- save all acf options in one meta_value [closed]