WordPress.org

Ready to get started?Download WordPress

Forums

Listing of all uploaded files in network sites (6 posts)

  1. massimigliano
    Member
    Posted 1 year ago #

    Can I list all files uploaded by users in Network sites? In WPMU each user can manage their files with their own blog but the Super admin can't monitor all the uploaded files...how can i do that?

  2. It's Multisite, not WPMU :)

    And no. You can't list all files uploaded per user.

  3. David Sader
    Member
    Posted 1 year ago #

    I can monitor files as they are uploaded with the following snippet in mu-plugins:

    <?php
    add_action( 'add_attachment', 'ds_upload_email', 10, 2 );
    function ds_upload_email($post_ID) {
    	$to =  stripslashes( get_site_option('admin_email') );
    	$subject = 'A file was uploaded';
    	$message = get_permalink($post_ID).' was uploaded</a>';
     		wp_mail( $to, $subject, $message );
    
    }
    ?>
  4. That emails you on every upload? Yow... Not something you want to do on a huge and active site, I'd think ;)

  5. David Sader
    Member
    Posted 1 year ago #

    Of course it is not scaleable, but on a small "family" site or classroom teacher etc, it would work just fine to monitor uploads as they happen.

    Even so, wp_mail pumps out gazillions of emails for every comment/ping, the extra load for emails on every upload shouldn't be too taxing.

  6. And that would be why I turned off emails except on pending comments ;)

Topic Closed

This topic has been closed to new replies.

About this Topic