Questions tagged [media-modal]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
288 views

update_user_meta inside a popup/modal

I'm trying to create a popup/modal notification if a logged-in user has reached a certain level. I use the following code (simplified): function theme_achievements() { $value = user_total_posts(...
kiarashi's user avatar
  • 294
2 votes
1 answer
665 views

Is there a native wp.media way to detect who "opened" wp.media.frame

I added few custom fields via attachment_fields_to_edit and would like to show them only when certain theme or page builder image option opens the wp.media.iframe. Currently they are visible ...
Benn's user avatar
  • 1,023
0 votes
1 answer
520 views

How to destroy or dispose wordpress uploder/manager?

Can someone help me, I want to destroy my previous media uploder frame and remove all elements they have created to change the media file type but I cant do that, In last of my search, I have found in ...
Manyang's user avatar
  • 97
2 votes
0 answers
629 views

Add guid filter to attachment in media library grid mode

I'm trying to show in media modal box, attachments from a specific folder in my website and, correct me if I'm wrong, the best way to proceed is a like filter on wp_posts field GUID. Something like ...
user114036's user avatar
0 votes
1 answer
840 views

wp_enqueue_media(); in multiple widgets

I have this code which works perfectly if you use a single widget. However if you create another widget the uploader will overwrite both widgets settings. Does anyone know how this script can be ...
Danny Cooper's user avatar
1 vote
0 answers
363 views

How to submit data between wp_iframe and backbone.js in media upload

In short: On a post/page edit.php I want to be able to click Add media and open the default media uploader instead of Create Gallery on the left-side menu there is a custom tab. on this custom ...
Bardock's user avatar
  • 11
1 vote
1 answer
689 views

Only displaying zip files with wp media

I'm using wp.media() to invoke the WordPress media library modal in a custom taxonomy. In the pop up I only want to display zip files. I know I can limit the media library to just audio or video ...
Ralphonz's user avatar
  • 324
0 votes
2 answers
4k views

Displaying a specific sub-category's posts from wp_query

I have a modal category and in my modal category i have three sub-categories in it. Here is the structure of my modal category. -Modal -Water Pumps -Water Heaters -Electrical Here, i want to ...
Jc John's user avatar
  • 105
0 votes
1 answer
74 views

wordpress thumbnail onclick then modal will come out

I have a thumbnail in wordpress, now when the thumbnail image is click, i want a modal to appear. Something just a bootstrap modal. How Can i do this? . any tutoria with this?. there are only few ...
Jc John's user avatar
  • 105
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 ...
Kārlis Baumanis's user avatar
1 vote
1 answer
866 views

Use wp.media templates to create totally custom modal

Following up on this answer I'm trying to determine how to create a modal with completely unique menu items/content than the media modal. If you add a new state you can add a new menu tab and have ...
helgatheviking's user avatar
1 vote
0 answers
210 views

How to get the return value of wp.media({ frame: 'post' }) in all cases?

When the user is in an edit.php page or post-new.php, the wp.media global is available and I want to use it to open a special insertion view that allows videos. var frame = wp.media({ frame: '...
Alain Jacomet Forte's user avatar
0 votes
1 answer
1k views

WP Media Uploader modal conflicts with Bootstrap modal

I was creating a form in a Bootstrap Modal to allow users to create new posts from the frontend. Everything seemed alright until I wanted to upload a file to the media library or choose one already ...
luke's user avatar
  • 533
1 vote
0 answers
78 views

Unable to upload image using the standard uploader in the WP admin (v4.3)

I am running WordPress 4.3 and in the admin I am no longer able to upload images using the standard upload image tool. I am taking over a project from another developer so don't know exactly what he/...
Zabs's user avatar
  • 111
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 ...
minnur's user avatar
  • 123
1 vote
1 answer
444 views

How to open the add media dialogue it in a certain state / tab?

I created a customized wp_view similar to embed (see wp-includes/js/mce-view.js, l. 868). I also have my own tab in the "add media" dialog. Naturally I want the edit button of my wp_view opening the ...
Paflow's user avatar
  • 268
1 vote
1 answer
1k views

Show media-frame-menu on custom Media Frame

I have a plugin I built that adds a custom media frame with the following: media_frame = wp.media.frames.media_frame = wp.media({ title: 'Select your images', button: { text: 'Use Image' }, ...
NonsenseSynapse's user avatar
3 votes
1 answer
23k views

How do I add the data-toggle="modal" data-target="#myModal" attribures to a WP Nav bar?

I'm new to Wordpress so please be patient! I've created a template in html5/ccs3 and am in the process of trying to make a wordpress template out of it. In my navigation menu (in html) I have a ...
Benn Moffat's user avatar
1 vote
0 answers
123 views

Set post_parent value for the images uploaded by Add Media button into post

I'm working on a front-end form plug-in and create shortcode to display front-end form on a page or post. While I was testing, I found all image files uploaded by Add Media button which will be ...
Ohsik's user avatar
  • 407
0 votes
1 answer
950 views

Removing delete permanently button in uploading files media

How do I delete or remove the word Delete Permanently in uploading files? I wanted to remove this permanently so that the users won't keep deleting files which are not supposed to delete. I use this ...
user avatar
3 votes
1 answer
788 views

What type of template are WP media-modal's templates?

I was looking at the Wordpress templates (html that's written to the page instead of awkwardly adding strings in JS). There are a lot of templates like this in a post editor for example: <script ...
NoBugs's user avatar
  • 432
-1 votes
1 answer
7k views

How to show woocommerce login / registration form in modal

I have developed E-commerce Website using Woocommerce Plugin. I would like to show the login/registration form in modal. Is there any way to automatically show the login/registration form when the ...
Tezah Zulueta's user avatar
0 votes
0 answers
2k views

Get URL of current featured image with JS in edit post view

Is it possible, somehow, to fetch the URL of the currently set featured image when you're in the edit post view? So far I've looked at fetching via jQuery such as: var url = jQuery('#set-post-...
INT's user avatar
  • 1,271
4 votes
1 answer
3k views

Refresh wp.media after ajax call

I'm building a plugin where I add a tab to the media manager and can add stuff from another source. I add the tab with this, which generates a iframe: add_filter('media_upload_tabs', '...
gubbfett's user avatar
  • 315
1 vote
0 answers
265 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 ...
Manny Fleurmond's user avatar
1 vote
0 answers
565 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 ...
Chloe LaPointe's user avatar
1 vote
1 answer
1k views

Get File Object from wp.Uploader

I would like to hook into the wp.Uploader and get the FileList object containing the file to be uploaded. So far I've been able to extend the uploader using the code below, but I can't quite seem to ...
user1411251's user avatar
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 '...
rugbert's user avatar
  • 168
1 vote
1 answer
2k views

WordPress Built In Dialog Box For My Plugin

I need a modal box like media upload in post edit page. but in that I just need to insert a html form using AJAX call .. I tried to get the output, but I cannot, so I tried ThickBox and I got the ...
Varun Sridharan's user avatar
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' =>...
Howdy_McGee's user avatar
  • 20.5k
1 vote
1 answer
4k views

How do I create a custom add media button modal?

I've created a custom media button for the admin in editing posts, but am having trouble figuring out how to create a view for the modal. I'm not trying to insert uploaded media; I'm trying to allow ...
jermspeaks's user avatar
1 vote
1 answer
925 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 ...
syntacular's user avatar
2 votes
0 answers
150 views

Edit single attachment on click (WP-admin)

I've created a custom media manager for a CPT I've created. I have everything functioning properly except an edit function. I want to have an edit button for each attachment that gets added to the ...
Austin Biggs's user avatar
1 vote
1 answer
685 views

How to check an ajax nonce in PHP

I'm modifying the media modal adding a new menu item to add external attachments to the media library. From the JS code I'm calling a PHP function that touches the database and accepts three ...
leemon's user avatar
  • 1,806
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 ...
cfx's user avatar
  • 1,491
0 votes
0 answers
39 views

Why doesn't Wordpress make thumbnails for videos?

I noticed videos in the media gallery always show as an icon preview (unlike files in a file manager, which show a thumbnail.) Considering that WP integrates Imagemagick, which apparently can extract ...
NoBugs's user avatar
  • 432
1 vote
1 answer
509 views

How to retrieve a value from an input field in a media view template

I've created a media view template with two input fields (width and height) and I was wondering how to retrieve the values entered in them in a media controller o view. PHP: function ...
leemon's user avatar
  • 1,806
12 votes
2 answers
3k views

How to trigger a refresh in the media modal

I'm developing a plugin that adds a new tab to the media modal, and I need to know a way trigger a refresh of the attachments tab so it shows newly added attachments. This is the code I'm using: wp....
leemon's user avatar
  • 1,806
4 votes
1 answer
267 views

Add control in image detail panel

I am trying to add a checkbox control in the image details popup (when editing image in a post). I have added the following code in my template function.php but I can't manage to display the checkbox ...
Mika A.'s user avatar
  • 141
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 ...
Sillo's user avatar
  • 110
1 vote
1 answer
826 views

Media Manager: refresh library after new selection

I have created a custom field into a metabox with a button that opens up the media manager and allows the selection of multiple images. On the "open" event, the gallery retrieves the images IDS of the ...
alex05's user avatar
  • 33
0 votes
1 answer
228 views

Open Media Uploader Link in single post or page

I want to open the media Upload Window like in a single post or page. It is important for me, to have that menu on top, which filters the media Library: This is my current code, which allows only to ...
user998163's user avatar
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 ...
Billy's user avatar
  • 249
3 votes
0 answers
137 views

Media modal in IE9 not working when included from plugin with wp admin scripts minified

This issue occurs with custom code that uses the WP Media modal, such as https://github.com/humanmade/Custom-Meta-Boxes or https://wordpress.org/plugins/categories-images/ The modal window does not ...
paul's user avatar
  • 338
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 ...
kaiser's user avatar
  • 50.5k
7 votes
1 answer
884 views

Best approach when modifying the Media Manager

I am trying to edit the Media Manager to allow the selection of a new option in the "Link to" select field. This Backbone template is currently defined in media-template.php <label class="...
Stewarty's user avatar
  • 312
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 ...
setterGetter's user avatar
0 votes
1 answer
848 views

Add class to oEmbed video from within post editor?

I'd like to be able to add classes to oembed videos on the fly in the post editor. This way I could have some videos act like images and alignleft or alignright and have text wrap around them, while ...
Michelle's user avatar
  • 3,438
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" ...
Vladimir Lukyanov's user avatar
1 vote
0 answers
90 views

Show error, when selecting image in WordPress media uploader if params mismatch

Good day ! My question is following: I know how to show errors while uploading image from WordPress media uploader by using WordPress filter hook: But how to show same error box when user select an ...
Vladimir Lukyanov's user avatar