wp_nonce_ays

Definition:
function wp_nonce_ays( $action ) {}

Display "Are You Sure" message to confirm the action being taken.
If the action has the nonce explain message, then it will be displayed along with the "Are you sure?" message.

Parameters

  • string $action: The nonce action.

Source code

function wp_nonce_ays( $action ) {

	$title = __( 'WordPress Failure Notice' );

	$html = esc_html( wp_explain_nonce( $action ) );

	if ( 'log-out' == $action )

		$html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() );

	elseif ( wp_get_referer() )

		$html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>";



	wp_die( $html, $title, array('response' => 403) );

}

3947

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: