Questions tagged [media-modal]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Is there an api documentation or good tutorial for the WordPress Media Uploader javascript Api?

I checked the developer docs and the codex, but I seem to be unable to find something on the Media Uploader javascript Api. Anybody knows some good resources on what can be done with the Media ...
0
votes
0answers
10 views

How to add user based tab to media upload manager with custom set of images?

By following the below link, I am able to create user-based tabs. https://wordpress.stackexchange.com/questions/185271/how-to-add-new-tab-to-media-upload-manager-with-custom-set-of-images I need to ...
1
vote
1answer
57 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 ...
0
votes
0answers
70 views

Using the admin media modal (wp.media) in custom meta box to grab external photos

I am looking to plug into the admin media modal for a custom meta box that I have created for my site. However, instead of having the admin media modal box display images from my local wordpress ...
0
votes
1answer
44 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
0answers
14 views

Whats the best way to change the modal details as per a certain post clicked?

So i have a Custom Post type named careers. There is a page called Career. This page contains the loop of the custom post careers. So Each post has a button called Apply and when i click the button ...
0
votes
0answers
26 views

Hide WP Media Uploader Window

It might need some code written into functions.php if you have any idea about it. General task is to hide this modal WP uploader window And Use Simple Browser uploader instead of WP uploader Thank ...
0
votes
0answers
16 views

Add custom data to media uploader

How can I add custom data to my Media object? Not to a specific attachment, but to the Media object itself, so that the custom data is sent along with any attachments uploaded to to the library which ...
0
votes
0answers
234 views

Media library filter 'Uploaded to this post' missing in Gutenberg's image insert modal

End goal: Get the select menu input box back to allow a user to filter results. "Uploaded to this post", "Mine", "Images", "Video", etc. while inserting a Gutenberg Image block; not a gallery. I'm ...
0
votes
1answer
176 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 ...
1
vote
0answers
140 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...' }, ...
0
votes
0answers
260 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
1answer
87 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" ...
0
votes
1answer
1k 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
1answer
2k 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
89 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 ...
3
votes
1answer
316 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
52 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
2answers
3k 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
275 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
992 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 ...
2
votes
1answer
3k 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
72 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
1k 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
117 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
661 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
573 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
148 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
111 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
284 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
37 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
512 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 ...
2
votes
0answers
103 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
945 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
152 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
270 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
281 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
418 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
694 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
279 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 ...
1
vote
1answer
428 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
2k 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
64 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 ...
9
votes
2answers
2k 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
504 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
185 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
836 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
72 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
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 ...
1
vote
1answer
349 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 ...