Questions tagged [media-modal]
The media-modal tag has no usage guidance.
137
questions
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-...
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 ...
0
votes
1
answer
737
views
WordPress Media manager select file button, how to prevent hiding?
In a customized mediamanager (base versione 3.5) I would like to keep displayed the "select file" button even when some files are already uploaded in the album. Is there a simple solution?
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 ...
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 ...
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...'
},
...
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'
},
...
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 ...
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 ...
0
votes
1
answer
947
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 ...
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 ...
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 ...
0
votes
1
answer
77
views
How to add extra EXIF data when images are uploaded?
I have a function to add EXIF information to an image after the image is uploaded to a website. How do I get the EXIF information to be automatically added to the image after the image is uploaded or ...
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!!
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 ...
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 ...
0
votes
1
answer
1k
views
overwrite wordpress gallery with custom gallery shortcode
I want to overwrite the default WordPress gallery shortcode with a custom one. This because I need to add a field that will contain an url for each image I want to add inside a gallery. I'm not sure ...
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 ...
1
vote
1
answer
117
views
Use custom image size in admin panel
I have add some image size like:
add_image_size( 'custom-small', 600, 600 );
add_image_size( 'custom-medium', 1280, 1280 );
add_image_size( 'custom-large', 2560, 2560 );
and I have removed all the ...
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, ...
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({
...
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 = &...
5
votes
2
answers
6k
views
How to restrict images in v3.5 Media Library modal to only those from a specific post id?
How can someone restrict the images which appear in the v3.5 Media Library modal to only show those that are attached to a specific post id?
I'm creating a front-end management template that allows ...
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'...
0
votes
1
answer
842
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 ...
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 ...
0
votes
2
answers
523
views
Implementing a modal(lightbox) for all images in all post-gallery posts
I'm trying to make a photo gallery page for all my photos in my post-gallery post and have a modal open when you click on the photos. In the page there will probably be almost 100 photos and i'm not ...
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 ...
2
votes
1
answer
270
views
Adding image to visual editor popup for shortcode with wp.media and wp.mce: changing image duplicates shortcode
tl;dr: Why does using media manager popup within a TinyMCE popup cause duplications of shortcodes? Is it my code or just the way life is? [Spoiler: It was my code]
I've written a small plugin to ...
0
votes
1
answer
463
views
Get selected image URL from wp.media.editor.attachment into text input fails. What am I doing wrong?
I have placed a media button as a post meta field to insert an image URL into a text field when Insert Into Page button is clicked. It works up to the point of opening the media repository window, ...
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 ...
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
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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....
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" ...
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 ...
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/...
0
votes
1
answer
3k
views
Opening a JQuery modal window on click of a button with a JQuery plugin
I am trying to open a Jquery Modal window on click of a button. And inserting this Button into a plugins content template (WP SHow posts). I'm using jquerymodal.com's modal code, since I don't need a ...
1
vote
1
answer
11k
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',...
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 ...
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 ...
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 ...
4
votes
1
answer
876
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
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 ...