Mywpnonces
1.0.0
MYWPNonces is a Library with WordPress Nonce functions in object-oriented way.
Declare a new instance:
$myNonces = new MY_WP_Nonces( 'my_nonce_action' );
$myNonces->createNonce();
Help: wp_create_nonce()
$myNonce->getNonceField( 'the_name_of_nonce', true, true );
3 Parameters are optional
Help: wp_nonce_field()
$myNonce->verifyNonce( $nonce );
1 Parameter is required!
Help: wp_verify_nonce()
$target_url = 'https://www.example.com/wp-admin/trash-something';
$myNonce->getNonceUrl( $target_url, 'the_name_of_nonce' );
First parameter is required and second is optional
Help: wp_nonce_url()
$query_arg = '_security';
$myNonce->checkAdminReferer( $query_arg );
1 Parameter is optional
Help: check_admin_referer()
$query_arg = '_security';
$die = true;
$myNonce->checkAjaxReferer( $query_arg, $die );
2 Parameters are optional
Help: check_ajax_referer()
$myNonce->areYouSure();
Help: wp_nonce_ays()