Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_reset_vars [ WordPress Function ]

wp_reset_vars ( $vars )
Parameters:
  • (array) $vars An array of globals to reset.
Defined at:



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.

Source


<?php
function wp_reset_vars$vars ) {
    for ( 
$i=0$i<count$vars ); $i += ) {
        
$var $vars[$i];
        global $
$var;

        if ( empty( 
$_POST[$var] ) ) {
            if ( empty( 
$_GET[$var] ) )
                $
$var '';
            else
                $
$var $_GET[$var];
        } else {
            $
$var $_POST[$var];
        }
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics