WordPress 3.5 Media Manager – add a button

In my plugin, I would like to add two buttons to Media Manager (to the left of “Insert Into Post” in “media-toolbar-primary” section), and connect a jQuery action to it. First one – The “Select All” button shoud allow to select all availabe images (only images), depending on option value selected (eg. All Media Items, … Read more

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 and ({$wpdb->posts}.guid LIKE ‘%/uploads_media_news/%’)). Problem is I don’t really know where to apply this filter: is it better … Read more

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 images: var mediaUploader; var $inputVal = $(‘input[name=”geoposts_overlay_ids”]’); var $inputBt = $(‘#geoposts_overlays_select’); $inputBt.click(function(e) { e.preventDefault(); if (mediaUploader) { mediaUploader.open(); return; } … Read more

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 regardless what button opens the uploader for example post “Add media” would not have any use for this option So I am kinda trying to find … Read more

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 create a visual editor button and popup that inserts a shortcode representing a “media object”: image to right, text … Read more