Upload::file_list()
Description #
Show the list of previously attached media.
Source #
File: lib/form/class-upload.php
public function file_list() { $medias = get_posts( array( 'post_type' => 'attachment', 'title' => '_ap_temp_media', 'post_author' => get_current_user_id(), ) ); // Show temporary images uploaded. $this->add_html( '<div class="ap-upload-list">' ); if ( $medias ) { foreach ( $medias as $media ) { $this->add_html( '<div><span class="ext">' . pathinfo( $media->guid, PATHINFO_EXTENSION ) . '</span>' . basename( $media->guid ) . '<span class="size">' . size_format( filesize( get_attached_file( $media->ID ) ), 2 ) . '</span></div>' ); } } $this->add_html( '</div>' ); }
Expand full source code Collapse full source code View on GitHub: lib/form/class-upload.php:197
Add your comment