wp_unslash

Remove slashes from a string or array of strings.

Description

(string|array) wp_unslash( (string|array) $value ); 

This should be used to remove slashes from data passed to core API that expects data to be unslashed.

Returns (string|array)

Unslashed $value

Parameters (1)

0. $value (string|array)
String or array of strings to unslash.

Usage

  1. if ( !function_exists( 'wp_unslash' ) ) { 
  2. require_once ABSPATH . WPINC . '/formatting.php'; 
  3.  
  4. // String or array of strings to unslash. 
  5. $value = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_unslash($value); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/formatting.php  
  1. function wp_unslash( $value ) { 
  2. return stripslashes_deep( $value );