- added nonce fields;

This commit is contained in:
nikitozzzzzzz
2018-11-21 14:01:18 +02:00
parent 9b083d8243
commit 0ceab69793
44 changed files with 393 additions and 213 deletions
+15
View File
@@ -22,6 +22,21 @@ if ( ! class_exists( 'um\admin\Admin_Functions' ) ) {
}
/**
* Check wp-admin nonce
*
* @param bool $action
*/
function check_ajax_nonce( $action = false ) {
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
$action = empty( $action ) ? 'um-admin-nonce' : $action;
if ( ! wp_verify_nonce( $nonce, $action ) ) {
wp_send_json_error( esc_js( __( 'Wrong Nonce', 'ultimate-member' ) ) );
}
}
/**
* Boolean check if we're viewing UM backend
*