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