PluginProbe ʕ •ᴥ•ʔ
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings / 1.0.255
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings v1.0.255
1.0.272 1.0.271 1.0.271.1 1.0.270 1.0.269 trunk 1.0.216 1.0.217 1.0.218 1.0.219 1.0.220 1.0.221 1.0.222 1.0.223 1.0.224 1.0.225 1.0.226 1.0.227 1.0.227.1 1.0.228 1.0.229 1.0.230 1.0.231 1.0.232 1.0.233 1.0.234 1.0.234.1 1.0.235 1.0.236 1.0.237 1.0.238 1.0.239 1.0.240 1.0.241 1.0.242 1.0.243 1.0.244 1.0.245 1.0.246 1.0.247 1.0.248 1.0.249 1.0.250 1.0.251 1.0.251.1 1.0.252 1.0.252.1 1.0.253 1.0.254 1.0.255 1.0.256 1.0.257 1.0.258 1.0.259 1.0.259.1 1.0.260 1.0.261 1.0.262 1.0.263 1.0.264 1.0.264.1 1.0.265 1.0.266 1.0.266.1 1.0.267 1.0.268
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / helpers / class-param.php
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / helpers Last commit date
class-arr.php 2 years ago class-attachment.php 2 years ago class-conditional.php 2 years ago class-db.php 2 years ago class-html.php 2 years ago class-param.php 2 years ago class-str.php 2 years ago class-url.php 2 years ago class-wordpress.php 2 years ago index.php 2 years ago
class-param.php
74 lines
1 <?php
2 /**
3 * The Helper class that provides easy access to accessing params from $_GET, $_POST and $_REQUEST.
4 *
5 * @since 1.0.0
6 * @package MyThemeShop
7 * @subpackage MyThemeShop\Helpers
8 * @author MyThemeShop <admin@mythemeshop.com>
9 */
10
11 namespace MyThemeShop\Helpers;
12
13 /**
14 * Param class.
15 */
16 class Param {
17
18 /**
19 * Get field from query string.
20 *
21 * @param string $id Field id to get.
22 * @param mixed $default Default value to return if field is not found.
23 * @param int $filter The ID of the filter to apply.
24 * @param int $flag The ID of the flag to apply.
25 *
26 * @return mixed
27 */
28 public static function get( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
29 return filter_has_var( INPUT_GET, $id ) ? filter_input( INPUT_GET, $id, $filter, $flag ) : $default;
30 }
31
32 /**
33 * Get field from FORM post.
34 *
35 * @param string $id Field id to get.
36 * @param mixed $default Default value to return if field is not found.
37 * @param int $filter The ID of the filter to apply.
38 * @param int $flag The ID of the flag to apply.
39 *
40 * @return mixed
41 */
42 public static function post( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
43 return filter_has_var( INPUT_POST, $id ) ? filter_input( INPUT_POST, $id, $filter, $flag ) : $default;
44 }
45
46 /**
47 * Get field from request.
48 *
49 * @param string $id Field id to get.
50 * @param mixed $default Default value to return if field is not found.
51 * @param int $filter The ID of the filter to apply.
52 * @param int $flag The ID of the flag to apply.
53 *
54 * @return mixed
55 */
56 public static function request( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
57 return isset( $_REQUEST[ $id ] ) ? filter_var( $_REQUEST[ $id ], $filter, $flag ) : $default;
58 }
59
60 /**
61 * Get field from FORM server.
62 *
63 * @param string $id Field id to get.
64 * @param mixed $default Default value to return if field is not found.
65 * @param int $filter The ID of the filter to apply.
66 * @param int $flag The ID of the flag to apply.
67 *
68 * @return mixed
69 */
70 public static function server( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
71 return isset( $_SERVER[ $id ] ) ? filter_var( $_SERVER[ $id ], $filter, $flag ) : $default;
72 }
73 }
74