get_plugin_updates

函数


get_plugin_updates ( No parameters )
返回值
  • (array)
定义位置
  • wp-admin/includes/update.php
    , line 383
引入
2.9.0
弃用

Retrieves plugins with updates available.

function get_plugin_updates() {
	$all_plugins     = get_plugins();
	$upgrade_plugins = array();
	$current         = get_site_transient( 'update_plugins' );
	foreach ( (array) $all_plugins as $plugin_file => $plugin_data ) {
		if ( isset( $current->response[ $plugin_file ] ) ) {
			$upgrade_plugins[ $plugin_file ]         = (object) $plugin_data;
			$upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];
		}
	}

	return $upgrade_plugins;
}