WP_Plugins_List_Table
- Since
- 3.1.0
- Source
wp-admin/includes/class-wp-plugins-list-table.php:17
Core class used to implement displaying installed plugins in a list table.
Compatibility
- WordPress
- since 3.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 16
Every hook that fires from inside WP_Plugins_List_Table, in the order it appears in the class, grouped by the method that fires it.
WP_Plugins_List_Table::prepare_items()
- apply_filters( all_plugins )filter line 103
- apply_filters( show_advanced_plugins )filter line 142
- apply_filters( show_advanced_plugins )filter line 147
- apply_filters( show_network_active_plugins )filter line 177
- apply_filters( plugins_list )filter line 307
WP_Plugins_List_Table::single_row()
- apply_filters( network_admin_plugin_action_links )filter line 1033
- apply_filters( plugin_action_links )filter line 1075
- apply_filters( plugin_action_links_{$plugin_file} )filter line 1097
- apply_filters( plugin_row_meta )filter line 1276
- do_action( after_plugin_row_meta )action line 1298
- apply_filters( plugin_auto_update_setting_html )filter line 1392
- do_action( manage_plugins_custom_column )action line 1421
- do_action( after_plugin_row )action line 1508
- do_action( after_plugin_row_{$plugin_file} )action line 1529
Properties · 1
$show_autoupdatesboolprotected- Whether to show the auto-updates UI.
Methods · 22
- __construct()Constructor.
- get_table_classes()
- ajax_user_can()
- prepare_items()
- _search_callback()
- _order_callback()
- no_items()
- search_box()Displays the search box.
- get_columns()
- get_sortable_columns()
- get_views()
- get_bulk_actions()
- bulk_actions()
- extra_tablenav()
- current_action()
- display_rows()Generates the list table rows.
- single_row()
- get_primary_column_name()Gets the name of the primary column for this specific list table.
- add_dependents_to_dependency_plugin_row()Prints a list of other plugins that depend on the plugin.
- add_dependencies_to_dependent_plugin_row()Prints a list of other plugins that the plugin depends on.
- get_dependency_view_details_link()Returns a 'View details' like link for a dependency.
- get_view_details_link()Returns a 'View details' link for the plugin.
Source code
class WP_Plugins_List_Table extends WP_List_Table { /** * Whether to show the auto-updates UI. * * @since 5.5.0 * * @var bool True if auto-updates UI is to be shown, false otherwise. */ protected $show_autoupdates = true; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @global string $status * @global int $page * * @param array $args An associative array of arguments. */ 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' ) ); } /** * @return array */ protected function get_table_classes() { return array( 'widefat', $this->_args['plural'] ); } /** * @return bool */ public function ajax_user_can() { return current_user_can( 'activate_plugins' ); } /** * @global string $status * @global array $plugins * @global array $totals * @global int $page * @global string $orderby * @global string $order * @global string $s */ public function prepare_items() { global $status, $plugins, $totals, $page, $orderby, $order, $s; $orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : ''; $order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : ''; /** * Filters the full array of plugins to list in the Plugins list table. *Changelog
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, from
src/wp-admin/includes/class-wp-plugins-list-table.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.