-
AuthorPosts
-
July 10, 2018 at 4:48 pm #983738
After the latest update the media modal is not working anymore on the frontend.
Before everything works as expected.
If I switch the theme away from Enfold, everything works as expected.For the frontend we use the standard WordPress media modal uploader. The same as on the backend.
Therefore we use the function wp_enqueue_media(); on the wp_enqueue_scripts hook for loading all the wp.media dependencies.So no, this is not the problem! The standard WordPress media modal image Uploader worked.
Now it hast stopped working!
On a clean testinstallation without Enfold, the Media Uploader works.
When I activate Enfold in the latest version, the Media Modal doesn’t work and I geht the known error:
TypeError: wp.media is undefinedThis error occurs, if you don’t enqueue the media modal dependencies.
If you do the wp_enqueue_media() function on the wp_enqueue_scripts hook, everything workes.
Before the latest Enfold update…I assume, that you remove things in the wp_enqueue_media() function with hooks.
This happens only on the frontend, in the backend (wp_admin()) the media modal works as expected.
And no, no performance options from Enfold are set.
We left the performance options untouched!
Neither were css or Js files merged nor are builder elements disabled.July 11, 2018 at 1:24 am #983920Hey kaoh,
Thank you for using Enfold.
Where can we see the issue? The theme doesn’t contain any hooks or filters that should interfere with the wp_enqueue_media function. The theme actually loads the same script on the theme options page.
Best regards,
IsmaelJuly 15, 2018 at 12:17 pm #985635we will make a testinstallation to reproduce this and then I handle you the credentials to log in ant test everything! please stay tuned!
July 16, 2018 at 4:02 am #985822July 31, 2018 at 11:37 am #991882Hello, we face the identical issue with the latest Enfold Theme Version 4.4.1.
We use the plugin http://wpfrontendpublishing.com/ and added an image upload dialog. This works works with an older versions of Enfold Theme but not anymore with 4.4.1 or even 4.4.0.We get the identical JavaScript error as above: TypeError: wp.media is undefined
Thanks for your help!
I provide you the credentials to a test environment to reproduce it easily:
July 31, 2018 at 5:41 pm #992007Hi,
Can you please try the following and check:
In file enfold\functions.php line 419 you find:
$condition2 = ( version_compare( get_bloginfo( 'version' ), '4.9', '>=' ) ) && $condition;
Before this line add:
$condition = true;
If you want us to do do that, please give us admin access and FTP access to your server.
Best regards,
GünterJuly 31, 2018 at 9:58 pm #992089Perfect, your suggestion with
$condition = true;
solved the problem!Thank you for the super fast solution and this excellent support!
Best Regards, ChrisAugust 1, 2018 at 7:46 am #992216Hi,
Awesome! Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Don’t forget to bookmark Enfold Documentation for future reference.Thank you for using Enfold :)
Best regards,
IsmaelAugust 6, 2018 at 4:51 pm #993991Hi,
I added a filter so it is no longer necessary to hack the source code:
/** * Allow to force loading of WP media element for 3rd party plugins * * @since 4.1.2 * @param boolean $condition * @param array $options * @return boolean */ $condition = apply_filters( 'avf_enqueue_wp_mediaelement', $condition, $options );
Return true for pages that need the media element.
Should be in the next update.
Best regards,
Günter -
AuthorPosts
- The topic ‘wp_enqueue_media() not working on frontend after latest update’ is closed to new replies.