Questions tagged [media-modal]

The tag has no usage guidance.

59 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
3 votes
1 answer
1k views

Restrict file types in the uploader of a wp.media frame

When creating a wp.media frame in JS, is it possible to specify allowed file types for the uploads tab? wp.media({ title: 'Pick a PDF', button: { text: 'Use this file...' }, ...
ax1mx2's user avatar
  • 131
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
3 votes
0 answers
187 views

Category checkboxes in upload modal

In a project I'm working on, I've enabled categories for attachments using: register_taxonomy_for_object_type('category', 'attachment'); In the edit attachment screen in the Media Library you see ...
leemon's user avatar
  • 1,806
2 votes
0 answers
190 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 ...
Virgo's user avatar
  • 99
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
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
0 answers
27 views

Is there any halfway decent documentation on the wp.media JS class?

Sorry for the somewhat rambly question, but has anyone ever seen any good piece of documentation, or maybe even a tutorial on the wp.media JS class? All that i could find documentation-wise is this ...
TimMKuehle's user avatar
1 vote
0 answers
60 views

How to enable sorting in custom media uploader in plugin

In my plugin I need a media uploader exactly like the one you see when you select a post's featured image. I managed to do almost everything with this code: media_uploader = window.wp.media({ ...
Pacicio's user avatar
  • 21
1 vote
0 answers
182 views

Display attachments by the ID of the post being edited in the wp.media frame (frontend)

There is a button in the frontend on the post page to upload images. How do I display attachments that are attached to this post in the wp.media frame? How to intercept wp.media's AJAX request for ...
Svetoslav Luchezarniy's user avatar
1 vote
0 answers
23 views

Suggested image dimensions Gutenberg Hook

I just migrated to Gutenberg block editor and I simply love it. After migration, I saw a dimension suggestion for images when trying to select the featured image. The problem is that we already have ...
MadWR's user avatar
  • 11
1 vote
0 answers
29 views

How to open default wp image editor screen dynamically?

I'm displaying gallery images of the logged-in users on the frontend with the edit button. Now I want to link that edit button with the default WP Image Editor screen that includes tools like crop, ...
Rameez Iqbal's user avatar
1 vote
0 answers
68 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 ...
DTFK's user avatar
  • 11
1 vote
0 answers
814 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 ...
Leroy's user avatar
  • 13
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
863 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
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
1 vote
1 answer
443 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
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
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 ...
Manny Fleurmond's user avatar
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 ...
Chloe LaPointe'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
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 ...
kitchin's user avatar
  • 261
1 vote
1 answer
404 views

Media Manager (since 3.5): How to show an empty Media Library when creating a media frame?

Is there a way to make sure the "Media Library" tab does not show any images until I start uploading some in the "Upload Files" tab? I am creating a wp.media frame with the following code: var ...
Sascha's user avatar
  • 21
1 vote
0 answers
1k views

Extending wp.media.model, query media from different blog on network and refresh view

I'm trying to extend the new wp.media.model to allow users to be able to choose any blog across the network and pull down the associated media library into the library content view. In the old ...
Chris_O's user avatar
  • 20.6k
0 votes
0 answers
12 views

How to show custom fields in modal in category page

The code below shows the title and content in the modal popup in category.php file. The full tutorial can be seen here although not important: https://artisansweb.net/load-dynamic-content-on-bootstrap-...
user3362364's user avatar
0 votes
0 answers
27 views

remove links in pop-up media gallery

Is it possible to remove certain links in the pop-up media upload screen? Is there a filter for the output of those links? We need to remove the links crossed out in this screenshot: We can hide them ...
shanebp's user avatar
  • 5,048
0 votes
0 answers
31 views

How to modify the uploads directory for wp.media.frame assigning an subfolder name

To be better organized I must be able to manage the media independently of the user. So in addition to restrict user to see only these files(images, docs, videos), I need to insert media for each ...
imagIne's user avatar
  • 41
0 votes
0 answers
21 views

image block select modal > custom tab on the media modal with filtered media and allow select media

I want to do a plugin to mark some media files as Favorite and then the favorite media marked allow be displayed on the Select image modal that is showed when a user try to add or replace an image via ...
juanbits's user avatar
  • 101
0 votes
0 answers
25 views

Remove Edit Attachment Button in Wordpress Mediathek -> see Screenshot

i would like to remove the button via css or hook, thanks for your help!!
Lothar's user avatar
  • 3
0 votes
0 answers
108 views

Set a minimum and maximum limit of images to select in the MediaUpload component for Block

Say that I am making a Block that accepts between 2 and 5 images with the MediaUpload component as input. How would I go about that? Ideally for UI I would like the multiple and addToGallery props to ...
Ben Toth's user avatar
0 votes
1 answer
81 views

Programtically selecting image URL in Media Library modal

I've been struggling with Backbone for a few hours now while I'm trying to select a custom image URL in the media modal. The idea is to have a button that I've coded already and when the user clicks ...
Hardeep Asrani's user avatar
0 votes
1 answer
24 views

Launch Media Library for specific MU site

I have a form on my front end that I'd like to call a media library modal, but I want the library accessed to be a specific MU subsite. I trued to switch_to_blog around the wp_enqueue_media function, ...
Picard102's user avatar
  • 933
0 votes
1 answer
252 views

Query data after an Ajax insert

After a successful insertion with Ajax of an entry I would like to see what the ID and url of that same entry is and show it in a modal window Any way to get that data? <script> ajax_url = &...
juan's user avatar
  • 1
0 votes
0 answers
40 views

Modal dialog under the backdrop

I am using Bootstrap 5 and modal is kinda tricky. Do you happen to know why the dialog is under the backdrop? I've compared the modal example on Bootstrap website and on my code. I haven't changed any ...
ddd's user avatar
  • 7
0 votes
0 answers
66 views

Display WP Meta Details in Bootstrap Modal

This question relates directly to a previous question I asked in Wordpress StackExchange: display WP image posts in Bootstrap 4 modal that was superbly solved by Sally CJ I further developed the ...
inputforcolor's user avatar
0 votes
0 answers
332 views

Insert HTML markup to page content from the Media Frame modal

TL;DR How do I get the HTML markup created in the Media Frame modal and insert it into the editor/page content? I'm trying to insert media from a custom router-tab in the media frame. But I have no ...
Mads Hansen's user avatar
0 votes
1 answer
281 views

Media Library modal customization

I have a fashion website and I use a large amount of images on my website, As I add new products I should add product images and for that I use media library modal but the problem is working with ...
ahmad shahoseini's user avatar
0 votes
1 answer
1k views

How do I link to a dynamic ACF button from a Custom Post type?

I have a custom post type archive that has articles that call some ACF content on each post. I've used WP_Query to pull these articles onto the archive page, and there's a button in each article that ...
Xero1's user avatar
  • 149
0 votes
0 answers
557 views

JQuery modal not loading video on popup, only displaying it after multiple reopenings

I am trying to load a PHP function into a modal, containing a video. I'm currently using jquerymodal.com's plugin to achieve that. Here's the current .js code I'm using: https://jmp.sh/v/...
festgebaeck's user avatar
0 votes
1 answer
349 views

Forbidden permission and editor error after update to Wordpress 5.1.1

Our website was recently update to Wordpress 5.1.1. From this recent update we had some issues that we have trouble debugging. 1. Cannot view media files on post editor Clicking the "Add media" ...
fsace's user avatar
  • 1
0 votes
0 answers
267 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 ...
ZWPDev's user avatar
  • 96
0 votes
0 answers
124 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 ...
Bhushan Gohel's user avatar
0 votes
1 answer
263 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. ...
Robert L's user avatar
0 votes
2 answers
277 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 ...
Sadia Mehjabin's user avatar
0 votes
1 answer
496 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 ...
Chris J. Zähller's user avatar
0 votes
1 answer
1k 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 ...
Nosebleed's user avatar
  • 349
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