filter_input() public method

Helper function for filtering super globals. Easily testable.
public filter_input ( string $variable, integer $type = INPUT_GET, integer $filter = FILTER_DEFAULT, mixed $options = [] ) : mixed
$variable string
$type integer
$filter integer
$options mixed
return mixed
 /**
  * Check the current request is a specific one based on action and
  * optional context
  *
  * @param string            $action_key
  * @param bool              $ajax
  * @param null|string|array $context_key
  *
  * @return bool
  */
 function maybe_process_on_action($action_key, $ajax, $context_key = null)
 {
     if ($ajax !== $this->is_ajax()) {
         return false;
     }
     $var_type = 'GET';
     if (isset($_GET['action'])) {
         $action = $this->as3cf->filter_input('action');
     } else {
         if (isset($_POST['action'])) {
             $var_type = 'POST';
             $action = $this->as3cf->filter_input('action', INPUT_POST);
         } else {
             return false;
         }
     }
     $context_check = true;
     if (!is_null($context_key)) {
         $global = constant('INPUT_' . $var_type);
         $context = $this->as3cf->filter_input('context', $global);
         if (is_array($context_key)) {
             $context_check = in_array($context, $context_key);
         } else {
             $context_check = $context_key === $context;
         }
     }
     return $action_key === sanitize_key($action) && $context_check;
 }