W3cubDocs

/WordPress

WP_Media_List_Table::__construct( array $args = array() )

Constructor.

Description

See also

Parameters

$argsarrayoptional
An associative array of arguments.

Default:array()

Source

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,
		)
	);
}

Changelog

Version Description
3.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_media_list_table/__construct