Skip to content

Commit b11640b

Browse files
committed
refactor: trigger routes action
1 parent e2dc62f commit b11640b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

includes/Core/Util/Route.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ public static function request($method, $hook, $invokeable)
6262

6363
public static function action()
6464
{
65-
$action = sanitize_text_field($_REQUEST['action']);
65+
$action = $_REQUEST['action'] ?? $_POST['action'] ?? $_GET['action'];
66+
$action = sanitize_text_field($action);
67+
6668
$sanitizedMethod = sanitize_text_field($_SERVER['REQUEST_METHOD']);
6769
$requestMethod = \in_array($sanitizedMethod, ['GET', 'POST']) ? $sanitizedMethod : 'POST';
70+
6871
if (
6972
isset(static::$_invokeable[$action][$requestMethod . '_ignore_token'])
7073
|| isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce(sanitize_text_field($_REQUEST['_ajax_nonce']), 'btcbi_nonce')

0 commit comments

Comments
 (0)