Under Media / Edit, there’s a means to list them, so I suggest you reuse the existing API.
Else, a general method, which works anywhere, is to run a db query with a left join:
select ID
from foo
left join bar
on whatever
where condition
and bar.ID is null;
Related Posts:
- Is using eval() ok in this scenario
- Get the blog page URL set in Options
- Using classes instead of global functions in functions.php
- Function to return true if current page has child pages
- What is the difference between wp_register_sidebar_widget and register_widget?
- Proper use of Output Buffer
- Change admin bar to default:off
- List of all theme customizer control types?
- Create “File-less” Page Template in Functions.php
- Need help setting default setting value for radio button in theme customizer
- function_exists call in function.php
- When to use esc_url, esc_html, esc_attr, and friends?
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Debugging an error: wp_enqueue_style was called incorrectly
- How to disable 3.1 “Admin Bar” via script for the admin user?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- First wordpress blog, should I make my own theme for maximum customizability?
- How to get the registered sidebar’s name by its id?
- How to change post thumbnail title and alt attributes to post title?
- Why might $input (Settings API) be coming through empty?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Dynamically change feature image in customiser
- One button to change all settings in theme customizer?
- Override default cropping in WordPress [duplicate]
- Get password when user registers and save it sha1 into database
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Removing the default sidebar from admin panel
- Merging PHP download script into `functions.php`
- Is there an error in get_the_tag_list()?
- Design view breaking on Pages
- Returning Variables back into a template
- Understanding WordPress child theme custom JS loading
- How can I loop into two different DIVS without repeating the DIVs
- Removing unnecessary wordpress files
- Allow users to add custom functions to wordpress theme
- Change date number to another language/script?
- How to add custom template tag in wordpress theme?
- Remove css styles from specific page
- Nesting Functions within Functions
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Custom php page in WordPress theme?
- How do I list the_tags() into HTML data-attribute
- Can’t access WordPress functions in file called via Ajax?
- How can I customize wp_footer, where is the code that controls what this function does?
- Can I change a variable in a content part while calling it?
- How to make thumbnail image fit into a div where image dimentions are completely different?
- More than one meta field in a single meta box?
- Is there a theme function for is_password_protected()?
- how do you create an admin interface in plugin for your theme
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- How to determine which custom header image is being shown
- Toggle Sidebar Display
- What is the fastest way to load PHP functions that are only used in one theme template?
- My Own layout in WooCommerce pages [closed]
- Differences when using the the_time and the_date functions
- How to store functions in… functions.php?
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- trying to use wp_handle_upload with ajax
- Can’t load WP function into external function
- Should I use include or load_template for including shortcodes, plugins and so on?
- Set WordPress Default Template
- Check if home.php and set home.php as page_on_front
- Custom URL parameters in template files
- Trigger popup in a php if/else statement
- What’s the difference between same wp functions get_posts(); functions in different form?
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Converting HTML Template to WordPress Theme
- Apply different Class for each element in a foreach()
- How to remove the cufon script from Dzonia Lite theme [closed]
- Should I use add_filter for functions in function.php of the theme?
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- Pass variable to hook. Its possible?
- defining a folder location in order to recall it
- How do I add custom bulk actions to multiple custom post types?
- what is the best practice to add new field to an api route
- WordPress get_post_meta issue
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- enqueue script if page is not equal to
- apply_filters to featured image
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How to add button to top of theme customizer?
- Mamp pro permalink issues. Pages keep reverting to index.php
- Adding code to the function file
- loading custom.js file after jquery is loaded
- Show post thumbnail only if it exists using timthumb
- Im using a right approach to use this class inside WordPress theme?
- Upgrade to WP 3.2/ and Server to php5 breaks theme? [closed]
- Adding php within a return statement [closed]
- I need a button to appear when not loged in and another when logged in, I need help fixing code PLEASE!
- Load slideshow.css file only if Slideshow is checked / on
- Creating custom function in wordpress to return data from database
- Getting URL of Resized Image
- Adding a new layout for genesis
- themeforce (happytables framework) implementation
- How can I fix my pagination?
- require used as a function to load theme dependencies?