js-error if wp_enqueue_media() called in the footer
-
If wp_enqueue_media() is not called from the action ‘admin_enqueue_scripts’ but directly from the code that adds the image upload field or from the action ‘wp_footer’
(so that media support scripts are loaded only if they are needed on the page), then when the “AI Engine” plugin is active, a js-error appears
“Uncaught TypeError: wp.media.view.settings.post is undefined” (immediately on page load) and image picker popup doesn’t work
https://prnt.sc/m2ddhiyZJlOAIf the AI ??Engine plugin is deactivated, then there is no such error and the popup functions normally.
If you call wp_enqueue_media() from the action ‘admin_enqueue_scripts’, then even with the active plugin “AI Engine” there are no errors and the popup works fine.
- The topic ‘js-error if wp_enqueue_media() called in the footer’ is closed to new replies.