Request class comes with Lightwight MVC and simplifies the obtention of values from $_GET, $_POST and WordPress’ $query_vars.


Add the use statement to include the class in your file, add this at the beginning of your php file:

use Amostajo\LightweightMVC\Request;

Then use the static method input() to get the value wanted:

$name = Request::input( 'name', $default_value );

Nonce fix

Add a third boolean parameter in order to prevent loops caused when calling to certain WordPress hooks. This has a critical use when calling for a nonce value:

$nonce = Request::input( 'my_nonce', $default_value, $clear_source = true );