wppaste
WordPress

WP_Media_List_Table

Since
3.1.0
Source
wp-admin/includes/class-wp-media-list-table.php:17
Core class used to implement displaying media items in a list table.

Compatibility

WordPress
since 3.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 7

Every hook that fires from inside WP_Media_List_Table, in the order it appears in the class, grouped by the method that fires it.

Properties · 3

$comment_pending_countarrayprotected
Holds the number of pending comments for each post.
$detachedprivate
$is_trashprivate

Methods · 24

Source code

class WP_Media_List_Table extends WP_List_Table {	/**	 * Holds the number of pending comments for each post.	 *	 * @since 4.4.0	 * @var array	 */	protected $comment_pending_count = array(); 	private $detached; 	private $is_trash; 	/**	 * Constructor.	 *	 * @since 3.1.0	 *	 * @see WP_List_Table::__construct() for more information on default arguments.	 *	 * @param array $args An associative array of arguments.	 */	public function __construct( $args = array() ) {		$this->detached = ( isset( $_REQUEST['attachment-filter'] ) && 'detached' === $_REQUEST['attachment-filter'] ); 		$this->modes = array(			'list' => __( 'List view' ),			'grid' => __( 'Grid view' ),		); 		parent::__construct(			array(				'plural' => 'media',				'screen' => isset( $args['screen'] ) ? $args['screen'] : null,			)		);	} 	/**	 * @return bool	 */	public function ajax_user_can() {		return current_user_can( 'upload_files' );	} 	/**	 * @global string   $mode                  List table view mode.	 * @global WP_Query $wp_query              WordPress Query object.	 * @global array    $post_mime_types	 * @global array    $avail_post_mime_types	 */	public function prepare_items() {		global $mode, $wp_query, $post_mime_types, $avail_post_mime_types; 		$mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; 		/*		 * Exclude attachments scheduled for deletion in the next two hours		 * if they are for zip packages for interrupted or failed updates.		 * See File_Upload_Upgrader class.		 */		$not_in = array(); 		$crons = _get_cron_array(); 		if ( is_array( $crons ) ) {			foreach ( $crons as $cron ) {				if ( isset( $cron['upgrader_scheduled_cleanup'] ) ) {					$details = reset( $cron['upgrader_scheduled_cleanup'] ); 					if ( ! empty( $details['args'][0] ) ) {						$not_in[] = (int) $details['args'][0];					}				}			}		} 		if ( ! empty( $_REQUEST['post__not_in'] ) && is_array( $_REQUEST['post__not_in'] ) ) {			$not_in = array_merge( array_values( $_REQUEST['post__not_in'] ), $not_in );		}

Changelog

Introduced in 3.1.0. One change between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

7.1.0
Method get_primary_column_aria_label() added.verified against source
3.1.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-admin/includes/class-wp-media-list-table.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.