WP_Plugins_List_Table::__constructpublicWP 3.1.0

Constructor.

Метод класса: WP_Plugins_List_Table{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_Plugins_List_Table = new WP_Plugins_List_Table();
$WP_Plugins_List_Table->__construct( $args );
$args(массив)
An associative array of arguments.
По умолчанию: array()

Заметки

  • Смотрите: WP_List_Table::__construct() for more information on default arguments.
  • Global. Строка. $status
  • Global. int. $page

Список изменений

С версии 3.1.0 Введена.

Код WP_Plugins_List_Table::__construct() WP 7.0

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