Definition:
function wp_reset_vars( $vars ) {}
Resets global variables based on $_GET and $_POST
This function resets global variables based on the names passed in the $vars array to the value of $_POST[$var] or $_GET[$var] or ” if neither is defined.
Parameters
- array $vars: An array of globals to reset.
Source code
function wp_reset_vars( $vars ) { for ( $i=0; $i<count( $vars ); $i += 1 ) { $var = $vars[$i]; global $$var; if ( empty( $_POST[$var] ) ) { if ( empty( $_GET[$var] ) ) $$var = ''; else $$var = $_GET[$var]; } else { $$var = $_POST[$var]; } } }
4059
No comments yet... Be the first to leave a reply!