how to use a single checkbox with wpalchemy?

WP Alchemy comes with example files that show the usage of virtually all field types; Example; <?php $mb->the_field(‘cb_single’); ?> <input type=”checkbox” name=”<?php $mb->the_name(); ?>” value=”abc”<?php $mb->the_checkbox_state(‘abc’); ?>/> https://github.com/farinspace/wpalchemy/blob/master/wp-content/themes/mytheme/metaboxes/checkbox-meta.php#L9

WPAlchemy – Checkboxes not saving

After more searching I decided to try one of the alternative methods listed in the checkbox-meta.php example file. I used a “foreach” loop instead of the “while” loop and the checkbox state is now loading properly. Here’s the updated code: <?php foreach ($items as $i => $item): ?> <?php $mb->the_field(‘t_enabled_widgets’, WPALCHEMY_FIELD_HINT_CHECKBOX_MULTI); ?> <input type=”checkbox” name=”<?php … Read more

WpAlchemy – _global_head is being output 3 times [closed]

The clue was in the original script here – line 460 of MetaBox.php has the comment “// todo: when first run define a constant to prevent other instances from running again …”. The code below fixed this issue. if(!defined(‘HEAD_CALLED’)): add_action( ‘admin_head’, array( $this, ‘_global_head’ ) ); define(‘HEAD_CALLED’, true); endif;