Hello,
When i’m creating a form on the front end, event if I specify ‘uploader’ => ‘basic’ in acf_form() the all wordpress upload library is loaded on the page ๐
There is a way to avoid that ?
Thank you !
Hi James,
Thank you for your anwser, however i was not very clear, i’m sorry.
With the “all wordpress image upload library” i mean the all code and scripts loaded with it on the page. For example when you load the wordpress image upload on the front end, all those script are added :
/wp-includes/js/jquery/ui/draggable.min.js
/wp-includes/js/jquery/ui/slider.min.js
/wp-includes/js/jquery/jquery.ui.touch-punch.js
/wp-admin/js/iris.min.js
/wp-admin/js/color-picker.min.js
/wp-content/plugins/advanced-custom-fields-number-slider/js/input.js
/wp-content/plugins/advanced-custom-fields-number-slider/js/simple-slider.js
/wp-includes/js/underscore.min.js
/wp-includes/js/shortcode.min.js
/wp-includes/js/utils.min.js
/wp-includes/js/backbone.min.js
/wp-includes/js/wp-util.min.js
/wp-includes/js/wp-backbone.min.js
/wp-includes/js/media-models.min.js
/wp-includes/js/plupload/plupload.full.min.js
/wp-includes/js/json2.min.js
/wp-includes/js/plupload/wp-plupload.min.js
/wp-includes/js/mediaelement/mediaelement-and-player.min.js
/wp-includes/js/mediaelement/wp-mediaelement.js
/wp-includes/js/media-views.min.js
/wp-includes/js/media-editor.min.js
/wp-includes/js/media-audiovideo.min.js
/wp-admin/js/editor.min.js
/wp-includes/js/quicktags.min.js
/wp-includes/js/wplink.min.js
/wp-includes/js/thickbox/thickbox.js
/wp-admin/js/media-upload.min.js
/wp-includes/js/tinymce/tinymce.min.js
/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js
(+ lot of html loaded directly on the page).
What i’m asking is : why all this code is loaded when I use โuploaderโ => โbasicโ. Like the wordpress uploader is not used, it shouldn’t be loaded.
(sorry for my bad english and thanks again for your answer).
Hi @manioums
Did you set the ‘post_content’ option to true or had a WYSIWYG field in the form? If you did, ACF’s need those library to make the WYSIWYG editor works correctly.
If you didn’t have that option or field, those libraries shouldn’t be loaded.
I hope this helps ๐
Hi @james,
Thank for your answer,
post_content is set to fasle, i do have a WYSIWYG on the page but set to basic.
The problem is not linked to this WYSIWYG basic editor because wheb i remove the Image Field completly, all the WordPress Upload Libray is is not loaded on the page anymore (and my basic WYSIWYG editor is still here).
Can you give me a fix in order to don’t have thoses very big library when the uploader is set to basic ?
Thank again ๐
Hi @manioums
This is weird. I’ve just tried it again on my installation, and the basic uploader setting didn’t load those libraries. Another weird thing is that the WYSIWYG field always loads those libraries, even with the basic setting.
Could you please tell me what ACF version do you use? Also, could you please share the JSON export of your field group so I can test it out on my installation?
Thanks!
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.