Front-end Post Submission JetFormBuilder image Upload Problem fixed

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

// Front-end Post Submission Form image Upload Problem fixed
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();
Auto Next Step on Radio Select in Elementor Form | MCQ Style Form

Auto Next Step on Radio Select in Elementor Form | MCQ Style Form

Give Temporary WordPress Access Without Sharing a Password

How to Give Temporary WordPress Access Without Sharing a Password

Crocoblock JetWooBuilder Not working? Try These Fixes

Crocoblock JetWooBuilder Not working? Try These Fixes

heartbeat and heart animations

Creating heartbeat and heart animations

Smokey Cursor Animation

Create Smokey Cursor Animation

Scroll to Top