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
- 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
- List of all theme customizer control types?
- Create “File-less” Page Template in Functions.php
- function_exists call in function.php
- 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)?
- 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?
- One button to change all settings in theme customizer?
- 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()?
- Returning Variables back into a template
- Change date number to another language/script?
- How to add custom template tag in wordpress theme?
- Remove css styles from specific page
- 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?
- Can I change a variable in a content part while calling it?
- More than one meta field in a single meta box?
- Is there a theme function for is_password_protected()?
- 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?
- 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
- 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?
- Populate editor with some content of a page with a page template
- Catchable fatal error: Object of class stdClass could not be converted to string after WP 4.7
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Skt full width basic slideshow problem
- How do I link a button I created in theme customizer to a function?
- Trying to retrieve post meta
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Redirect to another page using contact form 7? [closed]
- Custom theme, contact form 7 & fast secure form doesn’t work
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- WordPress admin-ajax.php
- Use .php file as page instead of wordpress page & template file?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Change the “Default Avatar” admin option via functions.php
- How to call multiple functions from multiple files into a WordPress page template [closed]
- get_template_directory adding FTP root folders in urls
- JQuery undefined and Stylesheet loads in bottom along with js files
- How to call the_time current?
- What is the best way to define constant options for a theme?
- How to make function appear in sentence?
- get_page_templates only return templates with “home” in the filename
- Is there a hack for using is_page() within the function.php file?
- Show different website layout if no sidebar added
- Need advice on theme customizer and child themes
- How to make sure relative URL works when site is not on root domain?
- How to make excerpt image be full size instead of thumbnail?
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- How can I prevent a shortcode div from extending beyond its boundaries?
- Menu to the right of screen on desktop using Bootstrap 4
- Theme editing “post thumbnail” help
- Where can I find the declaration of `$_wp_theme_features`?
- Calling PHP function doesn’t work in index.php
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- 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
- How to add button to top of theme customizer?
- Mamp pro permalink issues. Pages keep reverting to index.php
- 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]
- Load slideshow.css file only if Slideshow is checked / on
- Getting URL of Resized Image
- themeforce (happytables framework) implementation
- How can I fix my pagination?