Returns the list of known plugins.
Description
Uses the transient data from the updates API to determine the known installed plugins.
Source
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;
}
Changelog
Version | Description |
---|---|
4.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.