原型

get_plugin_updates()

返回值

(array)  

源文件

路径:wp-admin/includes/update.php

<?php
...
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;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/get_plugin_updates/