Cannot get tags working from a WPAlchemy metabox with wp_editor()

sorry you were having trouble with my “Holy Grail”. It looks like you missed an important part in my functions.php sample: apply_filters(‘meta_content’,$simple_textarea->get_the_value(‘test_editor’)); You weren’t using WP Alchemy’s get_the_value method. So instead of: $richtextcontent = $page_type_richtext->the_value( ‘richfield’ ); yours should have been: $richtextcontent = $page_type_richtext->get_the_value( ‘richfield’ ); You were using the_value which echos out the value … Read more

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

Import data from arbitrary CSV to WPAlchemy meta fields

Here’s a piece of code similar to what I have used to fix the problem once imported the data: <?php define(‘MY_METABOX_ID’, ‘my_metabox_id’); define(‘MY_METABOX_PREFIX’, ‘my_metabox_prefix_’); define(‘MY_CUSTOM_POST_TYPE’, ‘my_custom_post_type’); // Include WordPress define(‘WP_USE_THEMES’, false); define(‘WP_DEBUG’, 1); require_once(‘../wp-load.php’); // extract all MY_CUSTOM_POST_TYPE posts $q = new WP_Query(‘post_type=” . MY_CUSTOM_POST_TYPE . “&nopaging=true’); // for each post while($q->have_posts()) { $q->next_post(); $p … Read more

wpalchemy repeating fields dropdown issue

I changed the code to loop through all pages, instead of using wp_dropdown_pages() function. Following is the new code <?php while($mb->have_fields_and_multi(‘col2-project’)): ?> <?php $mb->the_group_open(); ?> <p> <span>Select Project</span> <?php $mb->the_field(‘project-id-2’); ?> <select name=”<?php $mb->the_name(); ?>”> <option value=””>None</option> <?php global $thispost; $myposts = get_pages(‘post_type=portfolio&post_status=publish’); foreach($myposts as $thispost) : ?> <option value=”<?php echo $thispost->ID; ?>” <?php $mb->the_select_state($thispost->ID);?> … Read more

WPAlchemy Metabox rewriting slug

So the solution after much cursing and pulling of hair was to ditch the WP_Query and go with get_posts instead, while referencing post_title like so: <div class=”my_meta_control”> <p>Add or subtract Athena projects related to this project.</p> <label>Available Projects</label><br/> <?php $args = array(‘post_type’ => ‘athena_project’, ‘posts_per_page’ => 1000); $items = get_posts($args); $mb->the_field(‘item’, WPALCHEMY_FIELD_HINT_CHECKBOX_MULTI); foreach ($items as … Read more