PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.7.2
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.7.2
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / utilities / functions.php

functions.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.7.2, at includes/utilities/functions.php

42 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Get value from $_POST.
4 *
5 * @since 1.1.0
6 *
7 * @param string $needle Name of the searched key.
8 * @param mixed $default Optional. Value to return if the needle isn't found.
9 *
10 * @return string Returns the value if found; else $default is returned.
11 */
12 function sellkit_post( $needle, $default = null ) {
13 return sellkit_get( $needle, $_POST, $default ); // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification
14 }
15
16
17 /**
18 * Get value from $_GET or defined $haystack.
19 *
20 * @since 1.1.0
21 *
22 * @param string $needle Name of the searched key.
23 * @param mixed $haystack Optional. The target to search. If false, $_GET is set to be the $haystack.
24 * @param mixed $default Optional. Value to return if the needle isn't found.
25 *
26 * @return string Returns the value if found; else $default is returned.
27 */
28 function sellkit_get( $needle, $haystack = false, $default = null ) {
29
30 if ( false === $haystack ) {
31 $haystack = $_GET; // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification
32 }
33
34 $haystack = (array) $haystack;
35
36 if ( isset( $haystack[ $needle ] ) ) {
37 return $haystack[ $needle ];
38 }
39
40 return $default;
41 }
42