PluginProbe
SlimStat Analytics / trunk
SlimStat Analytics vtrunk
5.5.0 5.4.12 4.7.4 4.7.4.1 4.7.5 4.7.5.1 4.7.5.2 4.7.5.3 4.7.6 4.7.6.1 4.7.7 4.7.8 4.7.8.1 4.7.8.2 4.7.8.3 4.7.9 4.7.9.1 4.8 4.8.1 4.8.2 4.8.3 4.8.4 4.8.4.1 4.8.5 4.8.5.1 All 212 releases
wp-slimstat / src / Utils / Request.php

Request.php in SlimStat Analytics trunk, at src/Utils/Request.php

42 lines 961 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SlimStat\Utils;
4
5 class Request
6 {
7 /**
8 * Get a value from $_GET array
9 *
10 * @param string $key
11 * @param mixed $default
12 * @return mixed
13 */
14 public static function get($key, $default = null)
15 {
16 return isset($_GET[$key]) ? \sanitize_text_field(\wp_unslash($_GET[$key])) : $default;
17 }
18
19 /**
20 * Get a value from $_POST array
21 *
22 * @param string $key
23 * @param mixed $default
24 * @return mixed
25 */
26 public static function post($key, $default = null)
27 {
28 return isset($_POST[$key]) ? \sanitize_text_field(\wp_unslash($_POST[$key])) : $default;
29 }
30
31 /**
32 * Get a value from $_REQUEST array
33 *
34 * @param string $key
35 * @param mixed $default
36 * @return mixed
37 */
38 public static function request($key, $default = null)
39 {
40 return isset($_REQUEST[$key]) ? \sanitize_text_field(\wp_unslash($_REQUEST[$key])) : $default;
41 }
42 }