Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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">
jQuery(function($) {
$.wpalchemy.bind('wpa_copy', function(the_clone) {
$('.datepicker', the_clone).css('display','none');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment