If you’re using Crocoblock’s JetFormBuilder to create a front-end post submission form, you may have encountered an issue where the image upload field doesn’t work properly—the image doesn’t upload.
To fix this problem, simply copy the PHP code below and add it to your theme’s functions.php file, or use a plugin like Code Snippets to insert the code safely.
Next, go to your JetFormBuilder image upload field settings, open the Advanced tab, and paste the following CSS class name into the “CSS Class Name” field
After saving everything, you can now upload images from the front-end—the problem will be solved.
Watch the Full Video Tutorial
For a visual walkthrough, check out our step-by-step video tutorial attached beside this post. It will help you understand the implementation process more clearly.
Image upload input field class:
AllowUploadImgCrocoblock_PromiseWebIT
PHP code
class AllowUploadImgCrocoblock_PromiseWebIT {
public function __construct() {
add_action(
'jet-form-builder/media-field/before-upload',
array( $this, 'enable_guest_uploads' )
);
}
public function enable_guest_uploads( $parser ) {
$context = $parser->get_context();
$class_name = $context->get_class_name();
if ( empty( $class_name ) || strpos( $class_name, 'AllowUploadImgCrocoblock_PromiseWebIT' ) === false ) {
return;
}
$context->allow_for_guest();
$context->update_setting( 'insert_attachment', true );
$context->update_setting( 'value_format', 'id' );
}
}
// Init the class
new AllowUploadImgCrocoblock_PromiseWebIT();




