Simplest part is to filter attachment list. Use this code
add_filter('ajax_query_attachments_args', function($args) {
$args['meta_query'] = array(
array(
'key' => 'my_image_meta',
'value' => $some_value,
'compare' => '='
)
);
return $args;
});
However this code will filter all media library queries. You may want to pass some additional parameter from wp.media
. This answer may be helpful.
Related Posts:
- Custom “Uploads” Dir: “Edit Image” in Media Library broken
- Restrict file types in the uploader of a wp.media frame
- Trigger refresh for new media manager in 3.5
- Refresh wp.media after ajax call
- What type of template are WP media-modal’s templates?
- Only displaying zip files with wp media
- How to retrieve a value from an input field in a media view template
- Uppload image from another source wp.media
- Multiple media uploader buttons target only one input on the same page
- Modal working only on home page
- How to open the add media dialogue it in a certain state / tab?
- Get File Object from wp.Uploader
- Where to upload JavaScript file in WordPress
- Show a popup message when file is uploaded
- wp_handle_upload returns a critical error response or invalid form submission
- How to get file object from file_attachment?
- How to locate the js code and php code for certain function?
- Insert HTML markup to page content from the Media Frame modal
- uploading image to wordpress site with javascript fetch function failed
- How do I add a class to Customizer preview based on class of Customizer control? (Customizer Javascript API)
- wp.media – drag&drop overlay stuck
- Trying to deque some .js from source
- How to make async query in wordpress?
- LayersWP Customizer White Blank Screen
- Get a default customizeAction text for a section using Customizer JS API
- Dynamically write in editor with Javascript
- Redirect to homepage if attmpting to leave intranet [closed]
- Taxinomy slug as var in parent archive page, without having a specific taxinomy page
- Twenty seventeen theme dropdown menu issue
- I want url from a file in media using title file
- How to verify that a field has a value before adding a term to a taxonomy
- Including js script at end of header
- Where is fusion-gmap-container?
- Dynamically changing logo on scroll function [closed]
- Escaping quotes while enqueuing scripts
- Changed media upload path for plugin, but generates error & shows wrong url
- The page isn’t redirecting properly was given when redirecting
- How To Pull Information From A Page And Input The Data In The WordPress User Database Table
- How to register or enqueue script and stop it being called in head?
- How to destroy or dispose wordpress uploder/manager?
- How to correctly load this jquery script through the file functions.php?
- contact form 7 javascript and wpcf7_before_send_mail action
- Adding javascript script to header via functions.php
- Variations Javascript not working when product display on Quick view via ajax
- adding script tag in head of specific pages
- How to use value from modal tinymce windowManager?
- wp_enqueue_media(); in multiple widgets
- how to refresh page after user logout with ‘wp_logout_url’?
- Open image gallery on link click
- How do I call for two js files into a custom template?
- How to delay display of page elements until enqueued script has injected html
- load-scripts.php loads incorrect file names
- How to change number field to text field using JS
- Enqueue concatinated JS file in WordPress
- Custom Media Meta fields to alter the generated image HTML that is inserted into a post for my animated GIF image player?
- wp_enqueue_scripts doesn’t work for template pages
- WordPress text widget with onclick function
- Create new product with woocommerce REST API with javascript (clientside)?
- Connecting a wordpress site to an AngularJS APP
- Can’t change javascript files
- WP Media Uploader modal conflicts with Bootstrap modal
- how to do open a link in a open window from menu bar? [closed]
- Combining results from WP-API using AngularJS
- JavaScript and Google PageSpeed + wp_enqueue_script
- Javascript file doesn’t load
- Script not working in post content
- How to create a dashboard for logged-in users with custom functionality? [closed]
- JavaScript problem in a WordPress PAGE
- Get URL of current featured image with JS in edit post view
- How to identify which javascript is being executed
- Put dynamic Javascript in header after doing operations
- Unserialize WP_Options options programatically?
- how to include js in widget?
- early enqueueing javascript file in page template, not in functions.php
- Wysiwyg editor not working on 4.2.2
- Editing the source of a display for posts (to category recent)
- Dequeue set-post-thumbnail.min.js
- How to adjust the selector used in JS to target only the one that was clicked on?
- WordPress 4.2 mce-views migration guide?
- Receive “menu-toogle” event from section menu in customizer
- Adding javascript blocks to a single file and adding it to the header
- None of the JavaScript works when using wp_editor
- JS files landing on page but not working, using childtheme of twentyeleven
- WordPress 4.1 crashes loading of ArcGIS Javascript API
- jQuery + more won’t load in header
- WordPress Media manager select file button, how to prevent hiding?
- Insert into post or
- How to modify a class in load-scripts.js ?
- Convert javascript running xml files to wordpress platform
- WOW.js Script Tag Initialization Header/Footer
- Remove WordPress default registration client side validation?
- How to integrate a different (JavaScript) editor in WordPress?
- JS enqueue path (localhost)
- Load and execute javascript from body
- Why can’t I load JS script in a plugin?
- Page template dynamic links based on browser size
- javascript errors on mobile browser, not on desktop
- 3.5.x Theme Customize: Handling Custom Control Requests
- Trigger a function during onload
- Loaded JavaScript file not showing [duplicate]