File Upload Not Working in WordPress 5.3.2
-
Tested with CMB2 versions 2.1, 2.6, 2.7
PHP version: 7.3After upgrading WordPress to 5.3.2, clicking the upload button or image on a file field simply doesn’t do anything. Clicking the delete icon on an image returns you to the top of the page editor but doesn’t remove the image.
These Github issues are related to the same problem, but they were closed without any fix suggestions.
Here is the setup code:
function add_theme_custom_fields() { $prefix = 'li_'; $page_meta = new_cmb2_box([ 'id' => $prefix . 'page_meta', 'title' => 'Page Meta', 'object_types' => ['page'], 'show_on_cb' => 'cmb_metabox_include_front_page', 'context' => 'normal', 'priority' => 'high' ]); $page_meta->add_field([ 'id' => $prefix . 'meta_image', 'name' => 'Image', 'type' => 'file', 'query_args' => array( 'type' => [ 'image/jpeg', 'image/png', ] ), 'row_classes' => 'no-border' ]); } function cmb_metabox_include_front_page($cmb) { $front_page_id = get_option('page_on_front'); return $front_page_id == $cmb->object_id; }
There are no errors in the browser console or in the server logs. There also aren’t any 404s for the resources; the CMB2 CSS and JS are being loaded. All of the metaboxes and their content are still displaying correctly; the media modal just won’t open for file fields.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘File Upload Not Working in WordPress 5.3.2’ is closed to new replies.