uploaded files are stored as attachment post type in WordPress. Use get_posts() and query for all attachments:
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => null );
$all_attachments = get_posts( $args );
EDIT – you can also set post_mime_type
in get_posts to get all of type ‘image/jpeg’ for example.
Related Posts:
- What plugin can I use to create a list / slideshow of featured images?
- Add jQuery to WordPress page
- Deleting images through upload folder, but not deleting from media library
- jQuery function didn’t work in my plugin
- how to include a simple jquery file into a wordpress plugin
- Pass a php string to a javascript variable
- Notepad sticky plugin
- Adding a slider captcha to the comment system
- How to put JQuery/Ajax inside shortcode?
- Error with Image Slide plug-in/ s3slider in WP
- wordpress site | All-in-one-cufon IE Issue
- WordPress function not being called from jQuery method
- How to prevent plugins from loading jQuery
- Using color picker in plugin, does input attribute order matter?
- Using window.onload with Ubermenu
- Media Upload Tab reload and change $_GET
- Redirect to another page using contact form 7? [closed]
- How to include this jQuery File in wordpress?
- wordpress add_action() issue in ajax call
- Adding media upload button to User Profile page (following a tutorial)
- JQuery prepend a function
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- Save user total active time after login in wordpress [closed]
- Programatically upload a file to be stored inside blob field in database, NOT on filesystem
- Api external with wordpress
- File Uploader – Upload without adding to Media Library
- Custom meta box with jQuery.sortable custom post type list
- Portfolio Slideshow Sliders Behaving Oddly When in jQuery Ui Tabs
- WordPress slider that allows image, headline, text, and button?
- How do I reinit WordPress plugins dynamically using jS?
- WordPress jQuery Post – Amending Variable Value Within Function Command
- WP Ajax DB issues
- How to get a specific string from a url
- the content of the uploads folder gets deleted periodically, how to figure out what causes it?
- update_post_meta is not working for me when I use e.preventDefault for update button
- 500 Internal server error wp_handle_upload_prefilter
- Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?
- Flexslider empty slide
- Soflyy WP All Import Custom File Download Issue
- Help with customising love it plugin (use within foreach)
- How to install jquery dotdotdot plugin for WordPress?
- How to create a dashboard for logged-in users with custom functionality? [closed]
- AJAX doesn’t pass variables to the php function in the plugin
- What is the process for reimplementing a back up WordPress?
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- PHP and Jquery pass value from form. Update function on DataBase
- Plugin use of ajax/jquery depending dropdown
- How do I output user_registered time in my correct timezone?
- wordpress jquery is not defined because the head tag is empty
- How to rename files during upload to a random string?
- wp_handle_upload – specified file failed upload test
- I want to allow certain file types on dokan upload files
- How can I make my custom shortcode work in a Custom HTML Widget?
- Post source link plugin – small modification
- Which hook callback has priority if both plugin and theme use the same hook?
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- Displaying admin notice dynamically
- Get total number of comment of the posts written by an author
- printf – problem to understand code
- Auto delete WordPress users according to time
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- add_query_arg not working
- Theme my Login plugin, how to update fields
- WordPress call_user_func_array() expects parameter 1 to be a valid callback, class
- Why is my custom post type not being activated on plug-in activation?
- What happens when WordPress memory limit is exceeded?
- Use wp_upload_dir() correctly
- A server-side hook failed when committing plugin code to SVN
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- Creating a widget and missing jQuery
- Need to replace Currency Shortforms
- How to delete all categories programatically?
- How to use custom Javascript code inside a plugin?
- How to use printf to output two links?
- Why do I get jQuery reference error / undefined when changing name of plugin file?
- How to prevent tabs from opening all at once
- Building a plugin into a theme
- 2 wordpress site same database
- Trying to include files in plugin isn’t working
- Custom Caption on WP Nivo Slider
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- How to authorize viewing and clicking a function only logged users?
- How to arrange custom posts in the backend/admin by custom taxonomy
- implement checkbox or toggle switch in plugin code
- Custom Field used to allow a Free Story; no longer works
- How to send new visitor to a splash page for only one time in wordpress?
- woocommerce with external ftp site
- GET web api method from a WordPress PHP script
- Adding link on title its in description but not in title see screenshots attached
- How to save information related to post in database?
- Save selectlist value (taxonomy) in wp:wp_set_object_terms
- Page doesn’t load
- How to fix ‘Call to undefined function do_settings()’ error?
- Passing an input variable through a switch statement
- how to get the url of a custom uploaded file
- cURL External API request displays content above other content on page
- A way to upload old html pages with all its assets via WordPress admin and to add a fixed menu on top of those (a la Wayback Machine)