public
Created

WPAlchemy: Modify cloned item of repeating field group

  • Download Gist
dates-meta.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<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(the_clone) {
$('.datepicker', the_clone).css('display','none');
//console.log(the_clone);
});
});
 
//]]>
</script>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.