Questions tagged [media-modal]
The media-modal tag has no usage guidance.
27
questions
25
votes
4
answers
4k
views
Trigger refresh for new media manager in 3.5
I'm trying to figure out how it's possible to 'refresh' the media library in the new media dialogue in 3.5. I'm adding images from an external image library to the WordPress library (via a tab/iFrame ...
30
votes
2
answers
6k
views
Enhance Media Manager for Gallery
I would like to enhance the Media Editor, after WordPress 3.5, on the gallery view.
I want to add a new select field on the right side and send the selected values to the gallery shortcode.
I think, ...
8
votes
5
answers
5k
views
Wordpress 3.5 Media Manager - add a button
In my plugin, I would like to add two buttons to Media Manager (to the left of "Insert Into Post" in "media-toolbar-primary" section), and connect a jQuery action to it.
First one - The "Select All" ...
3
votes
1
answer
1k
views
Modify Custom Field in Media Library using JavaScript
I've added a custom field into my media attachments:
function set_image_data( $form_fields, $post ) {
$form_fields['text_color'] = array(
'label' => 'Text Color',
'input' =>...
15
votes
2
answers
3k
views
Delete an attachment in the WP media modal window
I'm trying to create an option in the WP modal media window to detect duplicate files and delete a newer file if an older duplicate is found. I have the following code working (in conjunction with the ...
4
votes
3
answers
7k
views
Disable media library tab for non admins in uploader screen
I am developing a plugin in which i am required to allow front end users to upload media, which I am able to do. But I don't want to let them sneak into media library which comes as tab with uploader ...
2
votes
2
answers
2k
views
How to extend Media Library (WP 4.4)
I am trying to implement a new tab next to Media Library. I couldn't find solution to implement this. I found an example how to implement a new tab in this link: https://gist.github.com/Fab1en/4586865 ...
2
votes
1
answer
458
views
Adding fields to the media uploader with jquery listeners
So I have the code to successfully add a select field to my media uploader (gallery view) which is cool, but I also need to add some jquery listeners to that field.
I'm using the '...
2
votes
1
answer
3k
views
How to set additional parameter in wp.media?
I have this code.
$('.custom-browse-button').on('click', function(e) {
e.preventDefault();
var wpMedia = wp.media.frames.file_frame = wp.media({
'library': {
type: 'image'...
14
votes
1
answer
2k
views
Using the WordPress 3.5 Media Uploader window as a modal popup
I have a general question: is it possible to use the new WordPress 3.5 Media Uploader window for other purposes (i.e., as a modal popup window for content)? I would like to do this and have spent a ...
13
votes
1
answer
5k
views
Add filter function in media modal box
I'm trying to extend the media modal, but I cant' find any documentation / tutorials about it. I'm not a master of backbone too ;-)
I want to add a select box for each taxonomy that is attached to ...
11
votes
2
answers
4k
views
List of available events for wp.media
Is there a list of available events for wp.media object?
By doing some googling, I managed to find following events:
for wp.media.view.Modal.prototype: open, ready - they are triggered, when user ...
8
votes
1
answer
3k
views
Rendering the uploaded file in a wp.media object
I have seen this question asked a few times on SO and I don't see any responses.
I have a wp.media object (upload dialog), that I am using in to store an upload to a post as a meta element. It works ...
7
votes
1
answer
1k
views
Custom "Uploads" Dir: "Edit Image" in Media Library broken
Directory Structure
I have customized my (local) install (dev box). The current directory structure is:
./root
|- wp (WordPress Core root)
\
|- wp-config.php
|- wp-content (Content and ...
6
votes
1
answer
1k
views
Bind event on Media gallery elements WordPress
Good day !
Please help to get binding on WordPress Media Upload elements. When i click on any of gallery item need a custom function to fire up.
There is a BackBone collection called "Attachment" ...
5
votes
1
answer
2k
views
Filter media library items by size
I want to prevent users from being able to set a Featured Image from the media library if its width is less than 100px. Originally I thought to use the ajax_query_attachments_args filter, but it ...
5
votes
2
answers
2k
views
Expanding new Media Uploader in WordPress 3.5
In current version of WordPress it is quite easy to expand the attachments fields using attachment_fields_to_edit filter, but in latest WordPress 3.5 RC2 it's not working. We can expand it using ...
4
votes
2
answers
3k
views
Hook for image edit popup
Is there a hook for the popup window which shows up when you click on the edit button on an image in a post?
2
votes
1
answer
1k
views
Run script after clicking Set Featured Image in Media
I would like to run some script to get the featured image's width and height after the user clicked 'Use Featured Image' button and use the data retrieved within the Post Edit screen. Is there such ...
2
votes
1
answer
884
views
Filter medias from the Media Uploader (wp.media) modal with a post meta
I would like to have a media uploader modal that displays only image medias having a specific post meta, let's say 'my_image_meta'.
How could I achieve this ?
Here's my actual code, which just filters ...
1
vote
0
answers
561
views
Trying to add filename over image in Media Browser
My client wants to be able to see the filenames of his images in the media browser (not the media library, the browser when you are adding media to a post or page). I used this snippet to do that a ...
1
vote
0
answers
264
views
Media Modal not updating with file upload
I'm looking for a solution with the media modal. Here is the code that I'm using to create one that allows me to select files:
this._frame = wp.media( {
className: 'media-frame ...
1
vote
2
answers
398
views
How to change the image size in new Media Uploader (ie use medium vs thumbnail)
Is it possible to change the image size of the thumbnails in the new media uploader?
For example images are currently displayed using the "thumbnail" image crop size and I would like them to be the "...
1
vote
0
answers
640
views
Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
The post editor helpfully removes default arguments like columns="3" from the [gallery] shortcode. How do you tell it to remove a custom attribute that has a default value?
The answer at Enhance ...
1
vote
1
answer
923
views
Open the attachment details modal
The newer versions of WordPress, and possibly older ones, open an attachment details modal window when an image is selected in the media library. Is there a way that I can open this modal on a ...
1
vote
2
answers
958
views
Change Media modal image size
When i create a page, and click "Add media" button above the TinyMCE editor, the Media Modal shows up.
Question: How do i edit the size of the images showing in the modal?
The current images are ...
0
votes
1
answer
945
views
How to let a user select a media from the media library
Sorry for the low level of research but the media JS code was always a mystery to me, and googling doesn't show any current and reasonable answers.
The scenario is simple, I have a form in which I ...