WP_Plugins_List_Table::__construct
Constructor.
Method of the class: WP_Plugins_List_Table{}
No Hooks.
Returns
null. Nothing (null).
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
- See: WP_List_Table::__construct() for more information on default arguments.
- Global. String.
$status - Global. Int.
$page
Changelog
| Since 3.1.0 | Introduced. |
WP_Plugins_List_Table::__construct() WP Plugins List Table:: construct code WP 7.0.2
public function __construct( $args = array() ) {
global $status, $page;
parent::__construct(
array(
'plural' => 'plugins',
'screen' => $args['screen'] ?? null,
)
);
$status = 'all';
if ( isset( $_REQUEST['plugin_status'] ) ) {
$status = sanitize_key( $_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' ) );
}