pods_unslash

Filter input and return unslashed output.

Description

(array|mixed|object|string|void) pods_unslash( (mixed) $input ); 

Returns (array|mixed|object|string|void)

Parameters (1)

0. $input (mixed)
The string, array, or object to unsanitize

Usage

  1. if ( !function_exists( 'pods_unslash' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/includes/data.php'; 
  3.  
  4. // The string, array, or object to unsanitize 
  5. $input = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pods_unslash($input); 
  9.  

Defined (1)

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

/includes/data.php  
  1. function pods_unslash( $input ) { 
  2.  
  3. if ( '' === $input || is_int( $input ) || is_float( $input ) || empty( $input ) ) { 
  4. return $input; 
  5.  
  6. $output = array(); 
  7.  
  8. if ( empty( $input ) ) { 
  9. $output = $input; 
  10. elseif ( is_object( $input ) ) { 
  11. $input = get_object_vars( $input ); 
  12.  
  13. foreach ( $input as $key => $val ) { 
  14. $output[ $key ] = pods_unslash( $val ); 
  15.  
  16. $output = (object) $output; 
  17. elseif ( is_array( $input ) ) { 
  18. foreach ( $input as $key => $val ) { 
  19. $output[ $key ] = pods_unslash( $val ); 
  20. else { 
  21. // @todo Figure out what to do to unescape mysql_real_escape_string 
  22. if ( pods_version_check( wp, '3.6' ) ) { 
  23. $output = wp_unslash( $input ); 
  24. else { 
  25. $output = stripslashes( $input ); 
  26.  
  27. return $output; 
  28.