WordPress at Your Fingertips
function is not described

WP_Plugins_List_Table::__construct() public WP 3.1.0

Constructor.

{} It's a method of the class: WP_Plugins_List_Table{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Plugins_List_Table = new WP_Plugins_List_Table();
$WP_Plugins_List_Table->__construct( $args );
$args(array)
An associative array of arguments.
Default: array()

Notes

Changelog

Since 3.1.0 Introduced.

Code of WP_Plugins_List_Table::__construct() WP 5.8.2

public function __construct( $args = array() ) {
	global $status, $page;

	parent::__construct(
		array(
			'plural' => 'plugins',
			'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
		)
	);

	$allowed_statuses = array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled' );

	$status = 'all';
	if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], $allowed_statuses, true ) ) {
		$status = $_REQUEST['plugin_status'];
	}

	if ( isset( $_REQUEST['s'] ) ) {
		$_SERVER['REQUEST_URI'] = add_query_arg( 's', wp_unslash( $_REQUEST['s'] ) );
	}

	$page = $this->get_pagenum();

	$this->show_autoupdates = wp_is_auto_update_enabled_for_type( 'plugin' )
		&& current_user_can( 'update_plugins' )
		&& ( ! is_multisite() || $this->screen->in_admin( 'network' ) )
		&& ! in_array( $status, array( 'mustuse', 'dropins' ), true );
}