Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



stripslashes_deep ›

Seit2.0.0
Veraltetn/v
stripslashes_deep ( $value )
Parameter:
  • (mixed) $value The value to be stripped.
    Erforderlich: Ja
Gibt zurück:
  • (mixed) Stripped value.
Definiert in:
Codex:

Navigates through an array and removes slashes from the values.

If an array is passed, the array_map() function causes a callback to pass the value back to the function. The slashes from this value will removed.



Quellcode

function stripslashes_deep($value) {
	if ( is_array($value) ) {
		$value = array_map('stripslashes_deep', $value);
	} elseif ( is_object($value) ) {
		$vars = get_object_vars( $value );
		foreach ($vars as $key=>$data) {
			$value->{$key} = stripslashes_deep( $data );
		}
	} elseif ( is_string( $value ) ) {
		$value = stripslashes($value);
	}

	return $value;
}