0

I can find some little example on using multiple checkboxes, but no one about using a single checkbox in a wpalchemy metabox. Anyone can help me please?

No docs about this topic on the wpalchemy site..

Thank you

1 Answer 1

0

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

1
  • I already tried this approach but didn't work. I'll try again. But also some WPAlchemy_MetaBox class undocumented methods seems to be useful for this and don't work or I'm not able to make them work for some reason. For example, the_checkbox_state, get_the_checkbox_state and is_selected don't work properly in my context. Don't know. Also I'd really like to understand what some constants are used for. For example: WPALCHEMY_FIELD_HINT_CHECKBOX and WPALCHEMY_FIELD_HINT_CHECKBOX_MULTI Commented Apr 12, 2013 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.