get_plugin_updates() - WordPress 函数参考中文文档

返回介绍

get_plugin_updates()

发布于 2017-09-10 字数1405 浏览 918 评论 0

get_plugin_updates()

描述


返回值

(array)


源代码

File: wp-admin/includes/update.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;
}

更新日志

Version 描述
2.9.0 Introduced.

相关函数

Uses

  • wp-admin/includes/plugin.php:
    get_plugins()
  • wp-includes/option.php:
    get_site_transient()

Used By

  • wp-admin/includes/class-wp-automatic-updater.php:
    WP_Automatic_Updater::send_email()
  • wp-admin/update-core.php:
    list_plugin_updates()

User Contributed Notes

上一篇:get_plugin_page_hookname()

下一篇:get_post()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!