WP_Plugin_Install_List_Table::get_installed_plugins() WordPress Method

The WP_Plugin_Install_List_Table::get_installed_plugins() method is used to get the list of plugins that are currently installed on the site. This includes both active and inactive plugins.

WP_Plugin_Install_List_Table::get_installed_plugins() #

Return the list of known plugins.


Description

Uses the transient data from the updates API to determine the known installed plugins.


Top ↑

Return

(array)


Top ↑

Source

File: wp-admin/includes/class-wp-plugin-install-list-table.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.