submission ); } /** * Searches input for tags {field:FIELD_NAME} and replaces with field values. * Also replaces general tags such as {all_fields}. * * @since 1.0.1 * */ function af_resolve_field_includes( $input, $fields = false ) { // Get fields from the global submission object if fields weren't passed if ( ! $fields && af_has_submission() ) { $fields = AF()->submission['fields']; } // Render all fields as a table e.g. {all_fields} if ( preg_match_all( "/{all_fields}/", $input, $matches ) ) { $output = '
| %s |
|---|
| %s |
| %s |
| %s |
| %s | ', $sub_field['label'] ); } $output .= '
|---|
| %s | ', _af_render_field_include( $sub_field, $row_values[ $sub_field['name'] ] ) ); } $output .= '
| %s |
|---|
| %s |