WordPress at a glance
function is not described

WP_Media_List_Table::prepare_items() WP 1.0

This is a method of the class: WP_Media_List_Table

No Hooks.

Return

Null. Nothing.

Usage

$WP_Media_List_Table = new WP_Media_List_Table();
$var = $WP_Media_List_Table->prepare_items();

Notes

  • Global. WP_Query. $wp_query
  • Global. Array. $post_mime_types
  • Global. Array. $avail_post_mime_types
  • Global. String. $mode

Code of WP Media List Table::prepare items: wp-admin/includes/class-wp-media-list-table.php WP 5.2.2

<?php
public function prepare_items() {
	global $wp_query, $post_mime_types, $avail_post_mime_types, $mode;

	list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST );

	$this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter'];

	$mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];

	$this->set_pagination_args(
		array(
			'total_items' => $wp_query->found_posts,
			'total_pages' => $wp_query->max_num_pages,
			'per_page'    => $wp_query->query_vars['posts_per_page'],
		)
	);
}