In the frontend submission, the image_advanced, Image_upload are not working. It displays - An error occurred in the upload. Please try again later.
Also, the media pop up shows at the bottom (below footer). Append the image for visual identification.
https://1drv.ms/u/s!AjLgaRuebK87hplKFU6kTAEet8hkbw?e=xvTBSb
NOTE:
Code I have used.
<?php
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
function your_prefix_function_name( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => __( 'User Profile Content', 'your-text-domain' ),
'id' => 'user-profile-content',
'post_types' => ['user-profile'],
'fields' => [
[
'name' => __( 'Image Upload', 'your-text-domain' ),
'id' => $prefix . 'image_upload_003jih2nut6t',
'type' => 'image_upload',
'max_file_uploads' => 1,
'force_delete' => true,
'max_status' => false,
],
],
];
return $meta_boxes;
}
As per note in the MB Frontend submission
add the below code in the child-functions.php file
function mb_allow_subscriber_uploads() {
if ( is_admin() ) {
return;
}
// Replace 'subscriber' with the required role to update, can also be contributor.
$subscriber = get_role( 'basic' );
$subscriber->add_cap( 'upload_files' );
}
add_action( 'init', 'mb_allow_subscriber_uploads' );
However, the image option is working. Able to upload the file, but not able to edit, change or delete the image.