How to destroy or dispose wordpress uploder/manager?
If frame is an instance of wp.media, frame.detach() does the job for me.
If frame is an instance of wp.media, frame.detach() does the job for me.
From what I can tell, it sounds like you need to be using AJAX to update that user meta. Also you might need to retrieve the “content” with AJAX as well, so as to get the updated information if the popup modal is called again. There is a lot of documentation on AJAX in wordpress, … Read more
You will have to create two different media modals that are fired depending on your click event. Here is some code from a recent project where I added these buttons to the tinyMCE visual editor: jQuery(document).ready(function($){ $(document).on(‘click’, ‘.mce-my_upload_button’, upload_image_tinymce); $(document).on(‘click’, ‘.mce-my_upload_pdf_button’, upload_pdf_tinymce); function upload_image_tinymce(e) { e.preventDefault(); var $input_field = $(‘.mce-my_input_image’); var custom_uploader = wp.media.frames.file_frame = … Read more
While I can’t easily spot right now what is the cause of the bug, it is obvious that your approach is just wrong on two fronts The uploads from media library have no context, or at least it is not trivial to find out a context. An upload of font file by itself do not … Read more
Try: <select class=”size” name=”size” data-setting=”size”> <option value=”thumbnail”>thumbnail</option> <option value=”medium”>medium</option> <option value=”medium_large”>medium_large</option> </select>
Got some assistance from another forum. It spurred some brainstorming at the office and we came up with a solution. Not sure if this is the best way to resolve it but it is working as expected. I added this code: delete_post_meta($id, ‘add_class’, true); just above the: return $html; at the end of the last … Read more
WordPress Media Uploader : How to add custom button on featured image tab
So your script is doing exactly what you have told it to do. Here you are passing the element to the function, but you never use it, instead you just query all elements with a class and add another class. function moreinfoModal(field) { console.log(field.id); $(‘.moreinfo-modal’).toggleClass(‘open’); } What you should do is only add the class … Read more
Sometimes it happens when the JavaScript for the Modal plugin gets loaded twice. Please check to make sure that it isn’t getting double loaded. Some of the common ones are: bootstrap.js (the full BootStrap JS suite) bootstrap.min.js (same as above, just minified) bootstrap-modal.js (the standalone plugin) Similar Problem.
custom post type not showed with bootstrap 4 modal and template part