Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_nonce_ays ›

Depuis2.0.4
Dépréciéen/a
wp_nonce_ays ( $action )
Paramètres:
  • (string) $action The nonce action.
    Requis: Oui
Défini(e) dans:
Codex:

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.



Source

function wp_nonce_ays( $action ) {
	if ( 'log-out' == $action ) {
		$html = sprintf(
			/* translators: %s: site name */
			__( 'You are attempting to log out of %s' ),
			get_bloginfo( 'name' )
		);
		$html .= '</p><p>';
		$redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
		$html .= sprintf(
			/* translators: %s: logout URL */
			__( 'Do you really want to <a href="%s">log out</a>?' ),
			wp_logout_url( $redirect_to )
		);
	} else {
		$html = __( 'Are you sure you want to do this?' );
		if ( wp_get_referer() ) {
			$html .= '</p><p>';
			$html .= sprintf( '<a href="%s">%s</a>',
				esc_url( remove_query_arg( 'updated', wp_get_referer() ) ),
				__( 'Please try again.' )
			);
		}
	}

	wp_die( $html, __( 'WordPress Failure Notice' ), 403 );
}