Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Use this hook to determine how many rows should appear in a repeating field when the form is initially loaded.
Usage
add_filter( 'frm_repeat_start_rows', 'frm_add_rows', 10, 2); function frm_add_rows( $row_num, $field )
Parameters
- $row_num (int)
- $field (array)
Examples
Show ten rows
Use this code to show ten rows in your repeating section by default. Replace '10' with any number and replace '508' with the ID of your repeating section.
add_filter( 'frm_repeat_start_rows', 'frm_set_ten_rows', 10, 2);
function frm_set_ten_rows( $row_num, $field ){
if ( $field['id'] == 508 ) {
$row_num = 10;
}
return $row_num;
}