WordPress Media Library – acf_form uploaded images uploaded not showing
-
Hi,
We have a client website that uses ACF Pro to embed a form (using the acf_form() function) to create a ‘pending’ post for a custom post type that includes an image custom field. Anyone can submit this form (not just WordPress users).
However, when a user that isn’t a logged in user adds a photo, the form is uploaded successfully, but their image does not appear in the WordPress Media Library and in some cases pushed out of order to the very bottom of the library.
Our client pointed this out to us as they need to find that image in the gallery to add it to another field.
We’ve noticed that if you swap the gallery filter to something else (e.g. audio) and then back to ‘All Media Items’, the images do show up in order. The only difference I see between these photos is that the acf_form uploaded images have no author. I tried adding the author as Admin to the submitted post but that made no difference.
It seems the problem lies with the most current version of WordPress (4.9.4).
After running an old backup locally, it seemed to work fine (even when updating ACF Pro and deactivating all other plugins).Here’s the code for my form:
<?php acf_form_head(); ?> <?php acf_form(array( 'post_id' => 'new_post', 'post_title' => true, 'post_content' => true, 'updated_message' => __("Thank you - Post Submitted", 'acf'), 'submit_value' => __("Submit", 'acf'), 'return' => '/', 'fields' => array( 'field_58f74273f440c', 'field_58f74292f440d', 'field_58f7697cf01f4', 'field_58f742a0f440e', 'field_58f742b7f440f', 'field_59a93a00c446f', 'field_5abcf82ba8b4f', ), 'new_post' => array( 'post_type' => 'event', 'post_status' => 'pending' ) )); ?>
Does anybody have any input into this?
Hopefully WordPress are aware of this issue and will fix it in an upcoming update – possibly something to do with the database structure?
- The topic ‘WordPress Media Library – acf_form uploaded images uploaded not showing’ is closed to new replies.