Advertisements

wp_dashboard_browser_nag

Definition:
function wp_dashboard_browser_nag() {}

Source code

function wp_dashboard_browser_nag() {

	$notice = '';

	$response = wp_check_browser_version();



	if ( $response ) {

		if ( $response['insecure'] ) {

			$msg = sprintf( __( "It looks like you're using an insecure version of <a href='%s'>%s</a>. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ) );

		} else {

			$msg = sprintf( __( "It looks like you're using an old version of <a href='%s'>%s</a>. For the best WordPress experience, please update your browser." ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ) );

		}



		$browser_nag_class = '';

		if ( !empty( $response['img_src'] ) ) {

			$img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) )? $response['img_src_ssl'] : $response['img_src'];



			$notice .= '<div class="alignright browser-icon"><a href="' . esc_attr($response['update_url']) . '"><img src="' . esc_attr( $img_src ) . '" alt="" /></a></div>';

			$browser_nag_class = ' has-browser-icon';

		}

		$notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";

15006

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: