wpcf7_file_form_enctype_filter()CF7 1.0

A wpcf7_form_enctype filter callback that sets the enctype attribute to multipart/form-data if the form has file-uploading fields.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wpcf7_file_form_enctype_filter( $enctype );
$enctype (обязательный)
-

Код wpcf7_file_form_enctype_filter() CF7 5.9.3

function wpcf7_file_form_enctype_filter( $enctype ) {
	$multipart = (bool) wpcf7_scan_form_tags( array(
		'feature' => 'file-uploading',
	) );

	if ( $multipart ) {
		$enctype = 'multipart/form-data';
	}

	return $enctype;
}