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
- Gutenberg add a custom metabox to default blocks
- So much data in postmeta
- get_post_meta() unserialize issue – returns boolean(false)
- Unable to get Preview of Uploaded image within a Custom Meta box
- How to store the value of a custom field dropdown select for post referencing?
- Detect meta value changes when post is updated (post_updated)
- Custom Meta Boxes: Store two values in one repeatable field
- Up/Down voting system for WordPress
- post meta data clearing on autosave
- Problem in custom meta boxes
- Displaying Meta Box Image
- Undefined index error when saving content on metabox
- Metabox with multiple fields added by user and upload box
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Saving custom image meta fields
- Get all meta keys assigned to a post type
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Query post order by post and desc not working
- How to query posts with certain custom meta data, and output Post data
- How to Create Dynamic Fields in a Meta Box?
- Set front page option using custom fields?
- Add post meta fields, when creating a post using WordPress’ REST API
- Store array as single, serialized post meta field or many post meta fields?
- A better way to add a meta box to custom post types
- Custom Field Values not updating unless I click “Update” twice
- update_post_meta for repeated custom field [closed]
- Trying to update_post_meta function
- Custom Metabox additional item
- Ordering posts by custom field named “date” in backend
- Values entered in a meta box aren’t saved
- change order of images attached to post
- how can I show name and value of Custom Fields together?
- Enable a short code in the custom meta field
- Gravity Forms Update post meta from template [closed]
- Display metabox title for custom fields with values
- wordpress multi user question
- How to change text color depending on the number value (Using javascript)
- Gutenberg add a custom metabox to default blocks
- Adding Custom Metadata to my Archive/Posts page
- SQL query to change the value of a Custom Field
- Custom meta POST request fired twice when updating a post in Gutenberg
- add meta box considers the selected option as post parent
- How do I display a custom field in an existing form on the front end?
- Add custom field information to source meta data
- Delete custom meta
- wordpress simple post multi rating with post_meta and user_meta
- I want my post to republish again after adding a custom field
- Custom fields / meta box output
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- Colecting values from custom field checkboxes and displaying them in the post
- Build Array from Input Fields question
- How can i put a custom field inside this php