Skip to content

Instantly share code, notes, and snippets.

@tcherokee
Created February 11, 2011 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcherokee/c4b0978a565b37fd1d3c to your computer and use it in GitHub Desktop.
Save tcherokee/c4b0978a565b37fd1d3c to your computer and use it in GitHub Desktop.
function recipe_taxonomy() {
// Custom taxonomy for Recipe Ingredients
register_taxonomy(
'recipe_ingredients',
'mysite_recipes',
array(
'hierarchical' => false,
'label' => 'Ingredients',
'query_var' => true,
'rewrite' => true
)
);
}
<div class="my_meta_control">
<h4>Ingredients</h4>
<?php while($mb->have_fields_and_multi('recipe_ingredients')): ?>
<?php $mb->the_group_open(); ?>
<?php $mb->the_field('recipe_quantity'); ?>
<label>Quantity and Ingredients</label>
<p><input type="text" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>"/></p>
<?php $mb->the_field('recipe_ingredients'); ?>
<p><input type="text" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>"/></p>
<?php $selected = ' selected="selected"'; ?>
<br/><?php $metabox->the_field('ingredient_units'); ?>
<select name="<?php $metabox->the_name(); ?>">
<option value="unit"<?php if ($metabox->get_the_value() == 'unit') echo $selected; ?>>--Select Unit--</option>
<option value="bags"<?php if ($metabox->get_the_value() == 'bags') echo $selected; ?>>bag(s)</option>
</select>
<a href="#" class="dodelete button">Remove Document</a>
</p>
<?php $mb->the_group_close(); ?>
<?php endwhile; ?>
<p style="margin-bottom:15px; padding-top:5px;"><a href="#" class="docopy-recipe_ingredients button">Add Document</a></p>
<br /><p><a style="float:right; margin:0 10px;" href="#" class="dodelete-recipe_ingredients button">Remove All</a></p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment