Skip to content

Instantly share code, notes, and snippets.

@farinspace
Forked from emzo/dates-meta.php
Created October 25, 2011 16:20
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 farinspace/1313326 to your computer and use it in GitHub Desktop.
Save farinspace/1313326 to your computer and use it in GitHub Desktop.
WPAlchemy: Modify cloned item of repeating field group
<a style="float:right; margin:0 10px;" href="#" class="dodelete-dates button">Remove All Dates</a>
<p>Add dates on which this course will run.</p>
<?php while($mb->have_fields_and_multi('dates')): ?>
<?php $mb->the_group_open(); ?>
<?php $mb->the_field('date'); ?>
<p><input type="text" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>" class="datepicker" />
<a href="#" class="dodelete button">Remove Date</a></p>
<?php $mb->the_group_close(); ?>
<?php endwhile; ?>
<p style="margin-bottom:15px; padding-top:5px;"><a href="#" class="docopy-dates button">Add Date</a></p>
<script type="text/javascript">
//<![CDATA[
jQuery(function($) {
$.wpalchemy.bind('wpa_copy', function(e, the_clone) {
$('.datepicker', the_clone).css('display','none');
//console.log(the_clone);
});
});
//]]>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment