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
- SQL query based on two different custom field values
- Block Editor – Meta values not saved, meta changes to empty array on update
- Can I exclude a post by meta key using pre_get_posts function?
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Max length of meta_value
- Custom post meta field effect on the performance on the post
- How to get custom post meta using REST API
- Custom field/meta populated by dropdown of existing posts?
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- What is “meta_input” parameter in wp_insert_post() used for?
- How to enable revisions for post meta data?
- The “_encloseme” Meta-Key Conundrum
- Individual Widgets per Page
- Best way to programmatically remove a category/term from a post
- Gutenberg add a custom metabox to default blocks
- ‘Preview Changes’ for custom meta boxes?
- Using TinyMce with textareas in meta boxes on custom post types
- Using get_post_meta with new_to_publish
- add meta box – custom field : which to choose?
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Add metabox to document tab in gutenberg
- How to add add_meta_box to specific Page Template?
- So much data in postmeta
- Can I count the number of users matching a value in a multiple value key?
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- Auto sort the wp-admin post list by a meta key
- Adding another state (spam, reject, approve) to wordpress comments?
- get_post_meta() unserialize issue – returns boolean(false)
- What is the advantage of the wp_options design pattern?
- Arrange custom fields with drag and drop?
- Storing meta fields multiple times OR once with multi dimensional array?
- How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
- Unable to get Preview of Uploaded image within a Custom Meta box
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- Allow user to create instances of custom field
- Using media-upload.php to upload mp3 via custom fields
- extend Meta Box / Document Panel
- display specific custom fields
- Save metabox with multiple checkbox array
- Is there a hook / action that is triggered when adding or removing a post thumbnail?
- Add custom option to Standard Page Attributes Meta Box
- How to store the value of a custom field dropdown select for post referencing?
- get_pages sort alphabetically by meta value
- Add multiple images to a page sidebar
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- passing argument to get_template_part() or a better way to code
- Only show metabox when date-value in other metabox is over?
- Is it possible to store arrays in a custom field?
- Get updated meta data after save_post hook
- Detect meta value changes when post is updated (post_updated)
- Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post