# sellkit/1.6.2/includes/utilities/functions.php

SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster, version 1.6.2. 42 lines.

- Page: https://pluginprobe.com/plugins/sellkit/1.6.2/code/includes/utilities/functions.php
- Raw: https://pluginprobe.com/plugins/sellkit/1.6.2/raw/includes/utilities/functions.php
- Modified: 2023-04-13T06:28:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sellkit/1.6.2/code/includes/utilities/functions.php#L10-L20`.

```php
<?php
/**
 * Get value from $_POST.
 *
 * @since 1.1.0
 *
 * @param string $needle  Name of the searched key.
 * @param mixed  $default Optional. Value to return if the needle isn't found.
 *
 * @return string Returns the value if found; else $default is returned.
 */
function sellkit_post( $needle, $default = null ) {
	return sellkit_get( $needle, $_POST, $default ); // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification
}


/**
 * Get value from $_GET or defined $haystack.
 *
 * @since 1.1.0
 *
 * @param string $needle   Name of the searched key.
 * @param mixed  $haystack Optional. The target to search. If false, $_GET is set to be the $haystack.
 * @param mixed  $default  Optional. Value to return if the needle isn't found.
 *
 * @return string Returns the value if found; else $default is returned.
 */
function sellkit_get( $needle, $haystack = false, $default = null ) {

	if ( false === $haystack ) {
		$haystack = $_GET; // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification
	}

	$haystack = (array) $haystack;

	if ( isset( $haystack[ $needle ] ) ) {
		return $haystack[ $needle ];
	}

	return $default;
}

```
