Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [media-modal]

The tag has no usage guidance.

0
votes
1answer
38 views

admin_enqueue_scripts not working

enqueue.php function sunset_load_admin_scripts( $hook ) { if($hook != 'toplevel_page_mypluginname') { return; } wp_enqueue_media(); wp_register_script('sunset-admin-script',...
0
votes
0answers
14 views

custom post type not showed with bootstrap 4 modal and template part

I've created a showcase template part that will get all my custom post_type for a showcase. The problem is that I've 18 entries added and the template part will only show 10 entries. I've used a ...
0
votes
0answers
9 views

Detect after “attachment details pane” is shown so that I can manipulate its html content in WP 4.9.9 default media modal

I'm looking for a way, in Javascript, to write my callback to perform some operations on the HTML of the right sidebar area in the media editor, specifically the "ATTACHMENT DETAILS" plus the "...
2
votes
1answer
66 views

'Add Media' button doesn't work when editor is initialized from javascript

I am trying to instantiate the wp_editor with javascript, which works nicely except the 'Add Media' button does not work. There are no errors, but clicking the button does nothing. The simplest test ...
1
vote
0answers
45 views

WordPress 4.9.8 Trying to add filename over image in Media Browser

Need to add filenames of 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 but it no longer works in ...
0
votes
0answers
18 views

How to refresh the media uploader when running Gutenberg?

After installing Gutenberg, when I bring up the media uploaded while editing a post, the javascript I've been using in my plugin to refresh the images generates a TypeError error. This is the line of ...
0
votes
2answers
572 views

Bootstrap Modal isn't working in WordPress Plugin with Template Avada [closed]

I tried to develop a simple Wordpress plugin which shows a bootstrap modal and unfortunately I failed. The modal opens shortly but disappears directly again. This happens because the template Avada ...
0
votes
1answer
76 views

Modal opens all post IDs

This is my modal code. The first code displays and image, job title and name of each post ID. When the user clicks on the more info link it should open a button with more info about the post, but ...
2
votes
1answer
471 views

trigger('change') not working

I am using wp.media modal attachment API to import images to customizer. Along with the images, I have imported their meta data as well ( Title, Description, Alt Text etc.). These are in the form of ...
0
votes
0answers
218 views

Refresh media library gallery

This question is similar to Trigger refresh for new media manager in 3.5 but in this case wp.media.frame is undefined. I'm trying to refresh the contents of the media uploader but in some cases the ...
1
vote
1answer
1k views

Upload images from custom plugin using the media modal

I'm creating a custom plugin and I need users to be able to upload multiple images. I want them to be able to do this through the built-in media page but through a modal/pop up from the plugins ...
0
votes
0answers
63 views

Wordpress Media Uploader : How to add custom button on featured image tab

We are working on the plugin and try to add a custom button near 'set featured image' but we can not able to find out any solution or clue how to add it using media library function. Can someone ...
0
votes
1answer
555 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'...
0
votes
1answer
37 views

admin notice on Insert Media popup screen

I want an admin notice box on all media upload pages. I did that for media library page by code add_action( 'load-upload.php', array( $this, 'media_library_message_load' ) ); public function ...
0
votes
1answer
354 views

Keeping CSS model open after form submission

Using a simple CSS modal popup to display a form ( gravity form ) which works as expected but id like to make the user experience better. Currently when the modal button is pressed <label ...
1
vote
1answer
300 views

Is it possible to hide media details sidebar when wp.media popup is being opened?

Let's cut to the chase: popup = wp.media({ frame: 'post', state: 'insert', library: { type: [ 'image' ] }, multiple: false }); There is a list of arguments I use when ...
0
votes
1answer
101 views

Creating custom setting in add media popup

I am creating a checkbox in the Add Media popup screen to add HTML to the $html output when inserting an image. This is working fine. However, once I have added an image with the checkbox selected. ...
0
votes
2answers
51 views

WordPress Dropdown image select

I know this is much common and I did not find the right answer. So to show all possible image sizes I have done: add_filter( 'image_size_names_choose', 'fashmag_image_sizes_choose' ); function ...
0
votes
1answer
204 views

Changed media upload path for plugin, but generates error & shows wrong url

I'm writing a plugin that, as part of its functionality, uploads custom fonts. I'm using the new-since-Wordpress-3.5 media uploader & API. I've read dozens of tutorials on how to change the ...
0
votes
1answer
34 views

What's the best way to add taxonomy's image in 2017?

Need to build image upload for custom taxonomies. I used Categories Images plugin before, but now I need 2 images and this plugin doesn't fit anymore. I'm looking for a best solution. Does anybody ...
1
vote
0answers
349 views

Modal working only on home page

I have created a modal pop up using JavaScript. The HTML for the modal is in a get_template_part("content","contact")` file. The issue is, only on the home page does the modal pop up Through a click ...
1
vote
0answers
79 views

Perform a custom (bulk) action in media view

I wish to figure out how to add a custom action button in the media grid view ( upload.php screen) and how to perform a custom (bulk) action to the selected attachments, as shown in the screenshot ...
0
votes
1answer
701 views

How to create different media uploader frames / filter library depending on a custom action

Here is the thing. I am using the WP media uploader on the frontend. What I need is to have it behave differently depending on a certain action. I am attaching the media in a specific custom post ...
0
votes
1answer
96 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(...
1
vote
1answer
187 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 ...
0
votes
1answer
160 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 ...
2
votes
0answers
319 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 ...
0
votes
1answer
475 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 ...
1
vote
0answers
205 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 ...
0
votes
1answer
236 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 ...
0
votes
2answers
747 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 ...
0
votes
1answer
53 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 ...
5
votes
2answers
945 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 ...
1
vote
1answer
326 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 ...
1
vote
0answers
150 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: '...
0
votes
1answer
695 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 ...
1
vote
0answers
66 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/...
2
votes
1answer
1k 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 ...
1
vote
1answer
280 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 ...
1
vote
1answer
769 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' }, ...
3
votes
1answer
11k 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 ...
1
vote
0answers
40 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 ...
0
votes
1answer
435 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 ...
2
votes
1answer
431 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 ...
-1
votes
1answer
6k 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 ...
0
votes
0answers
871 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-...
4
votes
1answer
1k 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', '...
1
vote
0answers
110 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
0answers
259 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
1answer
410 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 ...