This was solved as simply as:
-
Hooking a custom .js script to the media-upload thickbox, so that it runs inside the iFrame:
function admin_styles_scripts_media_upload() { wp_register_script('mediajs', get_template_directory_uri().'/js/button.js', array('jquery'), true); wp_enqueue_script('mediajs'); } add_action('admin_print_scripts-media-upload-popup','admin_styles_scripts_media_upload'); ?>
-
Use the script to replace the default Save button with a custom one, and call
self.parent.tb_remove
from that:jQuery(document).ready(function() { jQuery('<a href="#" id="back_to_admin" class="button">Voltar para Edição</a>').insertAfter('.ml-submit'); jQuery('.savebutton.ml-submit').detach(); jQuery('a.toggle').live("remove"); jQuery('#back_to_admin').live('click',function() { parent.uploadedImages(); self.parent.tb_remove(); }); });
Related Posts:
- Trigger refresh for new media manager in 3.5
- Upload post thumbnail from the front end
- Users can’t upload images on frontend if they haven’t got access to the wp backend
- Display attachments by ID in a wp.media frame
- retrieve custom image sizes from media uploader javascript object
- WP 3.5 media manager – how to create a working gallery frame
- Refresh wp.media after ajax call
- wp_editor with media buttons
- Trigger JS when featured image upload window is opened in admin
- front end post with multiple upload images?
- Frontend Simple Local Avatar upload
- How to get the image url in the input box from media library?
- WP3.5 Media Uploader – how to make it accept multiple images?
- Add new media uploader at frontend for wp 3.5+
- insert post & Upload post thumbnail from the front end using ajax
- How to change upload directory based on frontend form input name or ID?
- wp_enqueue_media() Will not load JS on the theme
- Uploading images on front end doesn’t generate thumbnail sizes
- Switch between tabs on “Insert Media” dialog
- Front-End Social photo upload [closed]
- “send_to_editor” function returning pdf file name
- WordPress Media frame pre load images from ids
- Upload featured image from front end using media-upload.php
- Get File Object from wp.Uploader
- Edit User Profile From Front End
- Uploading PDF files from the front-end
- Upload and attach to a post multiple image files [closed]
- How to make Plupload zones that will survive changes in core?
- Better solution for managing media attachments with `wp_editor()`?
- Upload PDF and other files from the Front-End
- Front-End Upload media with category
- Frontend media shows “An error occurred in the upload. Please try again later.”
- Using Gravity Forms to upload media into library, then attach to post
- Large front end file uploads on cloud
- Link or button to open the media manager from frontend
- How to upload and add images to the existing post from the front-end with admin approval which is posted by other user
- Plupload Intergration in a meta-box?
- Physical organization of wordpress media library (Real Media Library plugin)
- Can I upload media to a specific folder?
- wp_upload_dir how to get just the directory name .
- How to generate thumbnails when needed only?
- Limit image upload to one and disable audio, video and other document file types to upload
- How to add new tab to media upload manager with custom set of images?
- No Thumbnails Generated
- Media files exist in upload folder but not showing up
- How to Require a Minimum Image Dimension for Uploading?
- How to upload files straight to S3 without using local storage? [closed]
- Extend Media Library
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- How to make “Upload files”selected by default in Insert Media?
- WordPress 3.5: Setting custom “full URL path to files” in the Media Library?
- Get $image_id after uploading with media_sideload_image()
- Submit post and upload image from front-end
- simple solution for restricting access to (some) uploads/downloads
- what happens to existing media files when I switch to year/month directory structure format?
- Reject upload of wrong-sized images using the Media Uploader
- WordPress Media Uploader events
- How to show all available images in WP’s media library when using the Polylang plugin?
- how to upload and allow downloads of .mobi and .epub formats
- Allowing WebP uploads?
- Give users a maximum upload capacity; limit the number of files a user can upload OR limit the number of files per upload
- Is it Possible to Extend WP Customize JS Methods?
- How to add a custom field to the media screen (image/gallery)?
- Can’t upload media, permissions are correct
- How to assign multiple file-mime-types to extension?
- Saving Media – Which Hook is Fired?
- Set limit to media upload?
- Is it possible to reorganize the WordPress uploads directory?
- WordPress 3.5: Switch back to Old Media Uploader?
- Save camera info as metadata on image upload?
- Media upload finished hook
- How to upload SVG in WordPress 4.9.8?
- How Can I Organize the Uploads Folder by Slug (or ID, or FileType, or Author)?
- How can I batch delete all unattached images with WP-CLI or other automated process?
- Create image formats with different qualities when uploading
- Rename files during upload using variables
- upload_async.php returns 500 error
- Which filters or actions to use after a media upload and delete?
- Organize uploads by year, month and day
- wp_delete_attachment doesn’t delete images in wp-content/uploads/
- Force WordPress 3.3 to use Flash uploader
- Custom “Uploads” Dir: “Edit Image” in Media Library broken
- Use a separate custom table (not posts) to handle file upload data
- WordPress AJAX File Upload – FrontEnd
- Upload folder is not writable, even when permissions are correct
- Different upload directory based on post type in a theme
- Media not actually deleted on disk when click “Permanent Delete”
- Image upload callback in new 3.5 media
- Add inline uploader to plugin option page
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- Can I use the wp media uploader for my own plugin?
- How to wp_upload_bits() to a sub-folder?
- Using same directory for storing all uploaded images on a WordPress network
- How to get attachment id as soon as it is uploaded through media uploader in jquery?
- Add tinymce buttons to caption textarea in media uploader
- Insert images to post not working
- Is it possible to allow zip files to be uploaded in WordPress?
- How to restrict images in v3.5 Media Library modal to only those from a specific post id?
- Allow CSV files to be uploaded
- Contact Form 7 – process form using a PHP script, instead of mailing [closed]