Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




check_ajax_referer [ WordPress Function ]

check_ajax_referer ( $action = -1, $query_arg = false, $die = true )
Parameters:
  • (string) $action Action nonce
  • (string) $query_arg where to look for nonce in $_REQUEST (since 2.5)
Defined at:



Verifies the AJAX request to prevent processing requests external of the blog.

Source


<?php
function check_ajax_referer$action = -1$query_arg false$die true ) {
    if ( 
$query_arg )
        
$nonce $_REQUEST[$query_arg];
    else
        
$nonce = isset($_REQUEST['_ajax_nonce']) ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce'];

    
$result wp_verify_nonce$nonce$action );

    if ( 
$die && false == $result ) {
        if ( 
defined'DOING_AJAX' ) && DOING_AJAX )
            
wp_die( -);
        else
            die( 
'-1' );
    }

    
do_action('check_ajax_referer'$action$result);

    return 
$result;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics