-
-
Save tcherokee/c4b0978a565b37fd1d3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recipe_taxonomy() { | |
// Custom taxonomy for Recipe Ingredients | |
register_taxonomy( | |
'recipe_ingredients', | |
'mysite_recipes', | |
array( | |
'hierarchical' => false, | |
'label' => 'Ingredients', | |
'query_var' => true, | |
'rewrite' => true | |
) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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