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?
- 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
- Import media to online WordPress from local development
- How to add a checkbox element to attachments editor with example
- What is the right way to include a wp-admin file in your theme?
- Theme Check gives: Required: This theme doesn’t seem to display tags?
- Is it possible to use line break in theme description?
- Organize uploaded media files
- Append button to WordPress Image Details modal
- Override Current Theme Setting in wp_config.php
- modify a output of a widget
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- Which is the simplest theme for WordPress to use it as your base?
- Is tag default in WordPress?
- Getting jquery to work with custom theme
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Why does WP recommend against custom favicon functionality in themes?
- What’s the best action to use when you want to do something only once per theme setup?
- Excluding a page with a certain name from wp_page_menu
- Widgets with groups / sub widgets? Widget in a widget?
- Avada resources still loading from localhost after database migration [closed]
- How do I create a custom partial / template?
- How should I be handling my theme version numbering?
- Multiple media uploader buttons target only one input on the same page
- Can’t manipulate media uploads
- What can I use for small text when converting to WordPress?
- How to i style the elements from the TinyMCE
- Integrate WooCommerce theme with a WordPress theme [closed]
- Automated Footer information
- How can I manage and limit disk usage for each author?
- How to develop a menu like wwe.com?
- How to escape multiple attribute at once in WordPress?
- Override plugin option by with a custom theme
- How can I modify the media upload form fields?
- Review site using WordPress
- How to create query to get top 3 sticky/latest posts
- Fatal error: Class ‘ZipArchive’ not found
- Is it possible to determine when user is at “Media > Add New” vs “Post > Add an Image”
- What happens if a theme is no longer supported?
- Running a function on post update with new post meta
- Check if( selected() )
- Modify available templates (in dropdown)
- multiple html/css files for wordpress theme?
- Create new wordpress theme with no need update
- Add image URL automatically to custom field?
- content filter (add_filter) for category description?
- How to use Canonical URL meta tag to avoid duplicate content issues with WP home pages
- getBoundingClientRect() showing different values on load vs scroll
- Host Private Custom Theme
- How to get custom logo with REST API instead of get_theme_mod();
- How can I change this SVG shape that’s generated?
- unsharp thumbnails after uploading image
- Can I set rest API endpoints from within a theme?
- Theme starter content translation is not working
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- Breaking Categories Up into Individual Divs
- Strip HTML tags on custom code from the_content
- wpdb->insert adds too many rows
- Set featured link not showing
- wpalchemy repeating fields dropdown issue
- WordPress loop not working on blog.php page
- Option to show/hide widget depending on is_home?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- How do I middle-align my header menu items in WordPress [closed]
- How to add Dummy content when active wordpress theme without xml import?
- Is there any reason that other theme elements (such as nav menus) shouldn’t be within the loop?
- Uploading media to wordpress API with C# HttpClient
- Not Able to Access Terms Under Custom Taxonomy Archive