Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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

share|improve this answer
    
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 –  Stratboy Apr 12 '13 at 8:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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