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

返回介绍

dismissed_updates()

发布于 2017-09-10 字数1927 浏览 775 评论 0

dismissed_updates()

描述


源代码

File: wp-admin/update-core.php

function dismissed_updates() {
	$dismissed = get_core_updates( array( 'dismissed' => true, 'available' => false ) );
	if ( $dismissed ) {

		$show_text = esc_js(__('Show hidden updates'));
		$hide_text = esc_js(__('Hide hidden updates'));
	?>
	<script type="text/javascript">

		jQuery(function($) {
			$('dismissed-updates').show();
			$('#show-dismissed').toggle(function(){$(this).text('<?php echo $hide_text; ?>');}, function() {$(this).text('<?php echo $show_text; ?>')});
			$('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});
		});
	</script>
	<?php
		echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">'.__('Show hidden updates').'</a></p>';
		echo '<ul id="dismissed-updates" class="core-updates dismissed">';
		foreach ( (array) $dismissed as $update) {
			echo '<li>';
			list_core_update( $update );
			echo '</li>';
		}
		echo '</ul>';
	}
}

更新日志

Version 描述
2.7.0 Introduced.

相关函数

Uses

  • wp-admin/includes/update.php:
    get_core_updates()
  • wp-admin/update-core.php:
    list_core_update()
  • wp-includes/l10n.php:
    __()
  • wp-includes/formatting.php:
    esc_js()

Used By

  • wp-admin/update-core.php:
    core_upgrade_preamble()

User Contributed Notes

发布评论

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

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