shorten up verify_nonces
This commit is contained in:
parent
f934e95449
commit
e0e830e399
@ -518,16 +518,13 @@ class ComicPressAdmin {
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
function verify_nonces() {
|
||||
if (isset($_REQUEST['cp'])) {
|
||||
if (is_array($_REQUEST['cp'])) {
|
||||
if (isset($_REQUEST['cp']['_nonce'])) {
|
||||
if (wp_verify_nonce($_REQUEST['cp']['_nonce'], 'comicpress')) {
|
||||
if (isset($_POST['attachments'])) {
|
||||
//coming from media editor
|
||||
return 'attachments';
|
||||
} else if (isset($_REQUEST['cp']['action'])) {
|
||||
} else if (isset($_REQUEST['cp']['action'], $_REQUEST['cp']['_action_nonce'])) {
|
||||
$action = $_REQUEST['cp']['action'];
|
||||
if (isset($_REQUEST['cp']['_action_nonce'])) {
|
||||
if (wp_verify_nonce($_REQUEST['cp']['_action_nonce'], "comicpress-${action}")) {
|
||||
$method = 'handle_update_' . strtolower(str_replace('-', '_', $action));
|
||||
return $method;
|
||||
@ -535,9 +532,6 @@ class ComicPressAdmin {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user