説明

The wpforms_entry_preview_fields filter lets you modify the fields displayed in the Entry Preview. This can be useful for hiding empty fields or rearranging the preview data before it is displayed. You can use this filter to hide fields without values, adjust labels, or completely remove specific fields from the preview display.

パラメータータイプ説明
$fieldsarrayEntry preview fields data. Each field includes its ID, label, and value.
$form_dataarrayForm ID.

ソース

wpforms\src\Pro\Forms\Fields\EntryPreview\Field.php

/**
 * Hide empty fields in the entry preview.
 */
function wpf_dev_hide_empty_preview( $fields, $form_data ) {
    $fields = array_filter( $fields, function( $field ) {
        return ! empty( $field['value'] );
    });
    return $fields;
}
add_filter( 'wpforms_entry_preview_fields', 'wpf_dev_hide_empty_preview', 10, 2 );

参考記事