$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>media - How to display all images "Uploaded By" an author|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin10PV0评论

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

Post a comment

comment list (0)

  1. No comments so far