WP_Plugin_Install_List_Table
- Since
- 3.1.0
- Source
wp-admin/includes/class-wp-plugin-install-list-table.php:17
Core class used to implement displaying plugins to install 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 · 7
Every hook that fires from inside WP_Plugin_Install_List_Table, in the order it appears in the class, grouped by the method that fires it.
WP_Plugin_Install_List_Table::prepare_items()
- apply_filters( install_plugins_tabs )filter line 135
- apply_filters( install_plugins_nonmenu_tabs )filter line 144
- apply_filters( install_plugins_table_api_args_{$tab} )filter line 236
Properties · 4
$orderpublic$orderbypublic$groupspublic$errorprivate
Methods · 15
- ajax_user_can()
- get_installed_plugins()Returns the list of known plugins.
- get_installed_plugin_slugs()Returns a list of slugs of installed plugins, if known.
- prepare_items()
- no_items()
- get_views()
- views()Overrides parent views so we can use the filter bar display.
- display()Displays the plugin install table.
- display_tablenav()
- get_table_classes()
- get_columns()
- order_callback()
- display_rows()Generates the list table rows.
- get_dependencies_notice()Returns a notice containing a list of dependencies required by the plugin.
- get_more_details_link()Creates a 'More details' link for the plugin.
Source code
class WP_Plugin_Install_List_Table extends WP_List_Table { public $order = 'ASC'; public $orderby = null; public $groups = array(); private $error; /** * @return bool */ public function ajax_user_can() { return current_user_can( 'install_plugins' ); } /** * Returns the list of known plugins. * * Uses the transient data from the updates API to determine the known * installed plugins. * * @since 4.9.0 * @access protected * * @return array */ protected function get_installed_plugins() { $plugins = array(); $plugin_info = get_site_transient( 'update_plugins' ); if ( isset( $plugin_info->no_update ) ) { foreach ( $plugin_info->no_update as $plugin ) { if ( isset( $plugin->slug ) ) { $plugin->upgrade = false; $plugins[ $plugin->slug ] = $plugin; } } } if ( isset( $plugin_info->response ) ) { foreach ( $plugin_info->response as $plugin ) { if ( isset( $plugin->slug ) ) { $plugin->upgrade = true; $plugins[ $plugin->slug ] = $plugin; } } } return $plugins; } /** * Returns a list of slugs of installed plugins, if known. * * Uses the transient data from the updates API to determine the slugs of * known installed plugins. This might be better elsewhere, perhaps even * within get_plugins(). * * @since 4.0.0 * * @return array */ protected function get_installed_plugin_slugs() { return array_keys( $this->get_installed_plugins() ); } /** * @global array $tabs * @global string $tab * @global int $paged * @global string $type * @global string $term */ public function prepare_items() { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; global $tabs, $tab, $paged, $type, $term; $tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : '';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 6.7.7 tag, from
src/wp-admin/includes/class-wp-plugin-install-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.