在检查插件版本之前,请检查上次运行插件的时间。
原型
_maybe_update_plugins()
描述
出于性能原因,这可能已被移植到WordPress 2.6.1。这用于wp-admin仅经常检查而不是每次加载页面。
源文件
路径:wp-includes/update.php
<?php
...
function _maybe_update_plugins() {
$current = get_site_transient( 'update_plugins' );
if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
return;
wp_update_plugins();
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/_maybe_update_plugins/