media - How to display all images "Uploaded By" an author

admin2025-06-04  0

I have multiple users, that have the ability to upload media. When I look at the media library it shows the file information, and included at the bottom is an "Uploaded By 'username'"

How can I use this username to loop through the media library and display all images from a user?

Here's a picture of the information with the media.

I have multiple users, that have the ability to upload media. When I look at the media library it shows the file information, and included at the bottom is an "Uploaded By 'username'"

How can I use this username to loop through the media library and display all images from a user?

Here's a picture of the information with the media.

Share Improve this question edited Jan 22, 2019 at 9:25 Glorfindel 6113 gold badges10 silver badges18 bronze badges asked May 30, 2015 at 23:52 Chris HaugenChris Haugen 1971 gold badge1 silver badge7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 7

You can do it via WP_Query loop:

$args = array(
   'author'      => $author_id, // Replace with author id
   'post_status' => 'any',
   'post_type'   => 'attachment'
);
$query = new WP_Query( $args );

More info how to use WP_Query: Codex WP Query

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748987772a315412.html

最新回复(0)