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
- Babel 6 regeneratorRuntime is not defined
- What is JSONP, and why was it created?
- React – uncaught TypeError: Cannot read property ‘setState’ of undefined
- Cannot read property ‘push’ of undefined when combining arrays
- Add swipe left/right to web page, but use default swipe up/down
- Check if checkbox is checked with jQuery
- What does “res.render” do, and what does the html file look like?
- How to pause javascript code execution for 2 seconds [duplicate]
- Getting Error “Form submission canceled because the form is not connected”
- How to implement navbar using react
- function updateMap for Google Maps API
- Uncaught TypeError : cannot read property ‘replace’ of undefined In Grid
- Disable/enable an input with jQuery?
- npm – EPERM: operation not permitted on Windows
- How to refresh a Page using react-route Link
- ChangeDate – Date Picker Bootstrap
- Is there a sleep function in JavaScript?
- scrollIntoView Scrolls just too far
- Using $setValidity inside a Controller
- Combination of async function + await + setTimeout
- How to go from one page to another page using javascript?
- How to update array value javascript?
- Simulate Keypress With jQuery
- react router v^4.0.0 Uncaught TypeError: Cannot read property ‘location’ of undefined
- What’s the fastest way to square a number in JavaScript?
- JavaScript: Create and save file
- Adding options to a
- How to use scientific notation in js?
- String.Format not work in TypeScript
- jQuery Ajax POST example with PHP
- How to validate a credit card number
- TypeError: res.status is not a function
- What is define([ , function ]) in JavaScript?
- How do I pass the this context to a function?
- HTML5 rich-text inside textarea
- Angular 4 setTimeout() with variable delay and wait
- JSON.parse unexpected token s
- Escaping HTML strings with jQuery
- AngularJS errors: Blocked loading resource from url not allowed by $sceDelegate policy
- How to use z-index in svg elements?
- How do you completely remove Ionic and Cordova installation from mac?
- Why is this simple AngularJS ng-show not working?
- How to open a Bootstrap modal window using jQuery?
- window.location.replace() not working to redirect browser
- “Cross origin requests are only supported for HTTP.” error when loading a local file
- How to destroy a JavaScript object?
- JavaScript single line ‘if’ statement – best syntax, this alternative?
- retrieve custom image sizes from media uploader javascript object
- wp_enqueue_script : how to change loading order of scripts?
- Is there a core Sortable component in Gutenberg?
- Is there an equivalent of the PHP function sanitize_key in Gutenberg?
- How do I enqueue(or delay loading of) tags in individual page posts?
- Animations are not being triggered on Scroll
- Preserve Javascript Through Customizer Preview Navigation
- JavaScript in WordPress Customizer
- How to use div -ids in url to jump to specific post…Is trailing slash the culprit?
- Button insert link on front wp_editor not working
- How Can I Add OnClick Event To A Specific WordPress Menu Link
- Preloader for a WordPress Site
- Trying to integrate Zoho Campaign Form [closed]
- What’s the most efficient way to include this javascript in only a single post?
- How to add customizer control via javascript ( wp.customizer.control.add )
- How to get the return value of wp.media({ frame: ‘post’ }) in all cases?
- How to generate the COOKIEHASH from JavaScript
- How to execute Javascript on a WordPress page?
- Gutenberg select excerpt, use generated excerpt or use more block excerpt
- Unable To Call Javascript With Enqueue
- How to integrate a JS fiddle?
- Problem after upgrade to 3.6.1
- Hovercards and other hover over image functions don’t work anymore!
- Load JavaScript on specific page with @wordpress compiler
- How WP does Mortgage affordability calculation
- java console error about touch navigation
- When adding google tag script in website, functionality not working
- Update block once an API request returns with a value
- How to improve WP-Rest atrocious response time?
- How should I identify the inline javascript that is the dependent of a wp_enqueue_script?
- How do I add a class to Customizer preview based on class of Customizer control? (Customizer Javascript API)
- Open image gallery on link click
- WordPress 4.2 mce-views migration guide?
- get_post_meta returns on side but it doesn’t return on bottom of admin page