wpmem_get()

Description

This is a utility function for checking and validating posted form variables and query strings via $_POST, $_GET, or $_REQUEST.  Checks if the variable is set and if not, sets a default value.

Parameters

$name
(string) (required) The name of the variable to get.

$default
(string) (optional) The default value if no value is retrieved or set. Default: null.

$method
(string) (optional) The method to retreive (post|get|request). Default post.

Return Value

boolean true|false

Usage

[gist id=”71999f4cb8ec461f56fc2263e2b131bb” file=”wpmem_get.php”]

Examples

[gist id=”71999f4cb8ec461f56fc2263e2b131bb” file=”wpmem_get_example.php”]

Changelog

Introduced in version 3.1.3

Source

wpmem_get() is located in /inc/api/php.