Embarrassing.
$(mediaUploader).on('select', function(){
Should be:
mediaUploader.on('select', function(){
In case anybody stumbles upon this, $({item}) looks for the item in the DOM, not the variable of the same name in the previous code. Since the select event isn’t firing in the DOM, the callback function isn’t going to fire either.
Related Posts:
- WordPress Media Uploader in page template (On Front-end)
- wp.media issue with selected image
- WordPress creating images if uploaded image is greater than 960px on one side?
- Convert base64 string to WordPress attachment uploads multiple images instead of a single one
- Possible to “Attach” images to multiple posts without inserting or uploading twice?
- get_attached_media() returns empty array if media file already used by another post
- How to force Media manager to overwrite files of same name?
- How can I stop WP media uploader from creating duplicates of my uploaded images?
- How wordpress handle upload images and how to use them in the code
- Get attachments by user
- How to regenerate thumbnails when they’re stored on S3
- How to manipulate “add media” pop-up
- How can one update a theme on a live site without interruption?
- Adding wp_enqueue_media(); causes problem
- How to upload images using Settings API
- trying to use wp_handle_upload with ajax
- Media Uploader in custom path
- Attach media to multiple posts
- Customizer: Unique identifier that distinguishes which image upload control is uploading an image
- Unable to check if image uploaded by wp_image_editor exists using file_exists function
- How can i attach the attachment-ID to the user profile image?
- Can I get the ID of an inserted / linked image?
- Can I add an icon & function to the “Upload/Insert” toolbar at the top of the content editor?
- In creating a theme, how can i allow a user to change an image outside post/page content?
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- HTTP Error when uploading images over specific dimensions
- Theming media inserts
- How to make the media library searchable by image title
- WordPress uploads do not show up and I see the white screen of death in some cases
- Can’t upload images on new theme
- How to load mediaelement.js in theme template?
- How would I get this to work – send to post from thick box
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- How to upload 3 attachments to current post?
- How to show Custom Field Value in Woocommerce Shop Page
- add class to all images inside the content
- How to echo inside the js file with wp_localize_script?
- Show all menu levels except top level. How to exclude top level of a menu?
- Unable to delete option
- Sanitizing existing media library paths and page links from foreign characters
- Cold Fusion to WordPress
- How to display latest posts with authors image
- Different WP Rest API custom endpoints across different themes
- Menu is in Reversed order
- How to set different localization file for different users?
- How to test another theme in a live WordPress website instead of live preview?
- How to display only the first two elements from ten same elements
- Is hand coding required at all?
- wp_delete_attachment doesn’t delete image files / doesn’t work
- custom js script is not loading
- How to show some of category in wordpress
- WordPress link to another page in site does not render a
- Template for front page (latest posts)
- using themename_the_custom_logo() in template-tags?
- WordPress Menu item > Sub menu Class update
- Is there some way to find if media items are used anywhere on the site?
- Avoiding do_shortcode() loops
- I don’t know why categories are showing below post
- Media uploads error
- Duplicate child theme incl. design changes
- Move the social media icons to the left of a WordPress nav menu for Soledad child Theme
- Why .widget-area is outside of .site-content in Underscores starter theme?
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- Using wp_add_inline_style Inside a Template File
- Styling the website via the customizer – do the changes stay after theme update?
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- Alt header logo and link for specific pages
- How to upload multiple images using WP rest API to media?
- Custom php template file only for mobile
- Issue with upload.php with media
- which template should I use for single category post?
- How to get next post and previous post URL in loop, single.php My WordPress 4.9.6
- home is not working in wordpreess
- how to edit woocommerce checkout page
- How to transfer all posts, pages and media
- Recall translations made with Poedit
- Media URL slugs without uploads folder path
- Standard technique for AJAX post endpoint: WP REST or WP API?
- Media files not loading
- Media files not loading
- Which theme PHP file should be edited in order to change Posts appearance
- Creating a theme just to deploy a single page
- Media library and Upload media problem
- Frontend media shows “An error occurred in the upload. Please try again later.”
- .htaccess and proxy settings for routing a decoupled REST API consuming theme
- Menu names not getting translated
- Why does the theme of secondary site load the primary one in WordPress Multisite? [closed]
- Creating a Sub Category Template
- How can I convert a list of title-posts into a sequence of comma separated text? [closed]
- How to connect two child themes on different sub domains to the same base theme
- How to add an import widgets functionality to wordpress themes without a plugin
- Is it possible to issue a theme update that requires a new plugin?
- Find callback function of custom meta box
- Should I use template files or just use conditional tags in index.php?
- Moving wp-content folder to public_html
- Is there a way to create sections under “Colors” panel in the Theme Customizer?
- Media not displaying other users uploads – WordPress 4.9.2
- Exporting wp site as a theme
- WordPress doesn’t load css, image and js files after moving local installation folder
- Developing WordPress site behind a static site