cf7-repeatable-fields
cf7-repeatable-fields copied to clipboard
Applied 'wpcf7_field_group_content' filter to HTML output
Applied a filter so developers can potentially prepopulate with dynamic data. Example usage:
/**
* Prepopulate Repeater Field
*
* @param string $default_html The full HTML content of the repeater group content.
* @param string $group_name The field name representing the repeater group as set in the `field_group` form tag.
* @param array $group An array of group data with keys for `tags` representing an array of scanned form tags and `raw` representing a string of raw HTML.
*
* @return string The full HTML content of the repeater group content.
*/
public function cf7_repeater_content($default_html, $group_name, $group)
{
$prefilled_html = '';
// Do stuff
return $prefilled_content ? $prefilled_content : $default_html;
}```
Thanks @Tessachu, but before I can merge the PR, can you please assign the result of the filter to a variable, add phpdocs, and also fix the indentation? Thanks!