Skip to content

Instantly share code, notes, and snippets.

@vfontjr
Last active March 20, 2020 18:09
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 vfontjr/872701b6819f820a0fd7892c8e2e3ca2 to your computer and use it in GitHub Desktop.
Save vfontjr/872701b6819f820a0fd7892c8e2e3ca2 to your computer and use it in GitHub Desktop.
<?php
add_filter('frm_setup_new_fields_vars', 'my_repeater_counter', 20, 3);
function my_repeater_counter($values, $field, $args ) {
if ( $field->id == 234 ){
$values['value'] = $args['key_pointer'] + 1;
}
return $values;
}
<?php
add_filter('frm_setup_new_fields_vars', 'my_repeater_counter', 20, 3);
function my_repeater_counter($values, $field, $args ) {
if ( $field->field_key == 'demo_name' ){
$values['value'] = $args['key_pointer'] + 1;
}
return $values;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment