Uma área de pesquisa sobre o WordPress para devs e autores do tema



update_nag ›

Desden/a
Obsoleton/a
update_nag ( Sem parâmetros )
Retorna:
  • (false|void)
Definido em:
Codex:

Ainda sem descrição.



Fonte

function update_nag() {
	if ( is_multisite() && ! current_user_can( 'update_core' ) ) {
		return false;
	}

	global $pagenow;

	if ( 'update-core.php' == $pagenow ) {
		return;
	}

	$cur = get_preferred_from_update_core();

	if ( ! isset( $cur->response ) || $cur->response != 'upgrade' ) {
		return false;
	}

	$version_url = sprintf(
		/* translators: %s: WordPress version */
		esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
		sanitize_title( $cur->current )
	);

	if ( current_user_can( 'update_core' ) ) {
		$msg = sprintf(
			/* translators: 1: URL to WordPress release notes, 2: new WordPress version, 3: URL to network admin, 4: accessibility text */
			__( '<a href="%1$s">WordPress %2$s</a> is available! <a href="%3$s" aria-label="%4$s">Please update now</a>.' ),
			$version_url,
			$cur->current,
			network_admin_url( 'update-core.php' ),
			esc_attr__( 'Please update WordPress now' )
		);
	} else {
		$msg = sprintf(
			/* translators: 1: URL to WordPress release notes, 2: new WordPress version */
			__( '<a href="%1$s">WordPress %2$s</a> is available! Please notify the site administrator.' ),
			$version_url,
			$cur->current
		);
	}
	echo "<div class='update-nag'>$msg</div>";
}