Create your metaboxes as you normally would, they will be visible by default. Then use js to hide the ones you dont want initially visible. Your code would look something like below. The example is for a checkbox, but you will get the idea how it works.
if ( $('input#_cmb_metaboxid_1').is(':checked') ) {
$('#metabox_id_2').show();
}
else {
$('#metabox_id_2').hide();
}
Related Posts:
- Passing error/warning messages from a meta box to “admin_notices”
- How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button
- Removing panels (meta boxes) in the Block Editor
- How can I create a taxonomy meta-box with search suggestions but no new terms input?
- How Does WordPress Remember Metabox Positions?
- How to Add Reminders/Notes to New Post Meta Boxes
- How to reorder meta box position?
- Custom Meta Boxes: multiple fields within a repeatable field
- Save checkbox value in metabox
- How to group meta boxes on the post edit page
- Metabox date month number to word
- get registered metaboxes by post type or post ID
- Remove metabox from specific page template in admin
- Is there a filter/action to add content to WP admin metaboxes?
- Attach Files Metabox
- How do I create a meta box for dates?
- esc before saving or before displaying does it matter?
- Add a meta description to home page?
- how to sanitize checkbox input?
- Set height of the categories meta box in post dashboard
- Save checkboxes of a metabox with a foreach loop (invalid argument)
- Add template meta box to category edit page?
- Get image captions for images on gallery post format metabox
- Multiple Checkboxes Metabox
- Adding Metaboxes – so much code is there a shorter DRY way?
- Consolidate Metaboxes into 1 Big Metabox
- I need a Simple image uploader with a simple screen. WP default has too many options.
- Show or hide custom meta box not work with Gutenberg
- TinyMCE with custom buttons on a meta box
- How do i hide the auto-generated custom field that’s created when update_post_meta() is called?
- Set the default value as checked for a meta box checkbox
- How to search by metadata using REST API
- Alternative to esc_textarea
- Display oembed in repeatable metaboxs using CMB2
- Automatically add a tag according to custom metadata
- How to add categories to page editor?
- Having trouble getting my meta data to save
- Display meta box on front end
- Show how many images are attached to a post/page on compose page
- metabox wordpress show in frontend
- Metabox context for page post type
- How to use MarkDown in a custom textarea field?
- How to use get_post_custom function on the blog page?
- Multiplicate entry on update_post_meta
- Populate meta select box with child pages
- Problem with meta box in Links
- Post Meta not saving when have empty post
- Remove ShareDaddy meta box from Pages only
- On click hide group of metabox, similar to screen options checkbox?
- How to make a stand-alone button to the post edit view
- wp_editor loses data, perhaps an html_entity_decode problem?
- How to list all tags as radio buttons in a meta box?
- How to position user meta data field
- Display Content if Meta Checkbox is checked?
- why add_menu_page use simple function as arg while add_meta_box a call back?
- Output from Meta Box Array
- add_post_meta() & update_post_meta()
- How to show the value of specific key from nested array?
- MetaBox with Editor instead of textarea – html not saved [closed]
- Use meta boxes inside an archive page template for Woocommerce
- Why do Metabox use Nonces?
- conditionally echo in meta box data loop
- Getting metabox value?
- Meta box does not save or update
- Meta Box multi checkbox in template
- Post Excerpt field only showing for default administrator
- remove a single post_meta
- Is ‘repeatable’ a field type for meta boxes?
- how to log in to WP if the “Log in” link under Meta is missing
- Custom loop attached to link
- Getting metabox value within a shortcode?
- ACF – Hiding metaboxes through screen settings doesn’t work
- Add metabox to pages that use custom template in WordPress
- Remove Username and just show Name in Author Metabox in backend
- how can I make this metabox area
- Metabox not saving values
- Update Post Meta in Front End with a form
- How to Edit & Update meta_box values from Front-End user Form
- Featured Gallery to custom post type
- Unable to save multiple images in wordpress
- Custom WP Meta Box – Use data from within the post screen inside meta box
- How to show select_advanced content instead of ID?
- Is this Edit Post Screen?
- use post meta in add_meta_boxes action
- Why is the text displaying, but not the textarea field itself?
- Meta box checkbox won’t save
- A correct hook for saving meta boxes data
- Add “Select” For Custom Post Type Metabox
- add_post_meta not saved
- Hooking into the Meta Boxes (Name/Web Address/Description) on the ‘Add New Link’ Page
- when saveing $meta_box i get Undefined index error
- Adding a Custom ‘Now’ button under ‘Published on’ header to return current date and time
- Adding meta boxes to custom post type
- Select Options Meta Data is Not Updating in Edit Meta Box
- Meta boxes not showing up
- Custom metabox with App Store / Google Play links
- How do I create a Meta box that can be repeated? (with an image section and text area)
- How can i remove blank area caused by theme’s post meta boxes?
- Need help, Passing variables with get_post_meta
- Is there a way to remove the Add boxes from the Screen Options menu metabox?