Description

The wpforms_field_file_upload_remove_webfiles_from_denylist_enabled filter allows removing HTM, HTML, and JS file extensions from the denylist for logged-in administrators in the File Upload field.

Parameters

$enabled
(bool) (Optional) Determines Whether to remove HTM, HTML, and JS from the denylist for logged-in admins, default is false.

Source

wpforms/pro/includes/fields/class-file-upload.php

More Information

This filter is applied to determine whether to remove HTM, HTML, and JS file extensions from the denylist for logged-in administrators in the File Upload field. By default, these file types are denied for security reasons. Enabling this filter allows administrators to upload these file types.

Example

/**
 * Allow HTM, HTML, and JS file uploads for logged-in admins in the File Upload field.
 *
 * @link https://wpforms.com/developers/wpforms_field_file_upload_remove_webfiles_from_denylist_enabled
 *
 * @param bool $enabled Whether to remove HTM, HTML, and JS from the denylist.
 * @return bool
 */

function wpf_dev_allow_web_files_for_admins( $enabled ) {
    return true;
}
add_filter( 'wpforms_field_file_upload_remove_webfiles_from_denylist_enabled', 'wpf_dev_allow_web_files_for_admins' );