Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Use this hook to set a custom enctype for a form.
Usage
add_filter( 'frm_form_enctype', 'custom_form_enctype', 10, 2 );
Parameters
- $enctype
- $form (integer)
Examples
Set a custom enctype for a specific form
The default value is multipart/form-data. Use this code example to set it to empty.
add_filter( 'frm_form_enctype', 'custom_form_enctype', 10, 2 );
function custom_form_enctype( $enctype, $form ) {
$target_form_id = 832; // change 832 to your form ID.
if ( $target_form_id === (int) $form->id ) {
$enctype = '';
}
return $enctype;
}