';
$custom_tags = apply_filters( 'af/merge_tags/custom', array(), $form );
foreach ( $custom_tags as $custom_tag ) {
echo sprintf( '
%s
', $custom_tag['value'], $custom_tag['label'] );
}
if ( ! empty( $custom_tags ) ) {
echo '
';
}
if ( 'all' == $type ) {
echo sprintf( '
%s
', __( 'All fields', 'advanced-forms' ) );
}
$fields = af_get_form_fields( $form, $type );
foreach ( $fields as $field ) {
echo sprintf( '
', $field['name'] );
echo sprintf( '%s%s', $field['label'], acf_get_field_type_label( $field['type'] ) );
echo '
';
// Append options for sub fields if they exist (and we are dealing with a group or clone field)
$parent_field_types = array( 'group', 'clone' );
if ( in_array( $field['type'], $parent_field_types ) && isset( $field['sub_fields'] ) ) {
foreach ( $field['sub_fields'] as $sub_field ) {
echo sprintf( '
', $field['name'], $sub_field['name'] );
echo sprintf( '%s%s', $sub_field['label'], acf_get_field_type_label( $sub_field['type'] ) );
echo '
';
}
}
}
echo '
';
echo '