src/NowZoo/WPUtils/WPUtils.php
public static function trim_stripslashes_deep($value){
        if ( is_array($value) ) {
            $value = array_map(array(get_called_class(), 'trim_stripslashes_deep'), $value);
        } elseif ( is_object($value) ) {
            $vars = get_object_vars( $value );
            foreach ($vars as $key=>$data) {
                $value->{$key} = self::trim_stripslashes_deep( $data );
            }
        } elseif ( is_string( $value ) ) {
            $value = trim(stripslashes($value));
        }
        return $value;
    }
public static function trim_stripslashes_deep($value){
        if ( is_array($value) ) {
            $value = array_map(array(get_called_class(), 'trim_stripslashes_deep'), $value);
        } elseif ( is_object($value) ) {
            $vars = get_object_vars( $value );
            foreach ($vars as $key=>$data) {
                $value->{$key} = self::trim_stripslashes_deep( $data );
            }
        } elseif ( is_string( $value ) ) {
            $value = trim(stripslashes($value));
        }
        return $value;
    }
public static function trim_stripslashes_deep ( $ value ) { if ( is_array ( $ value ) ) { $ value = array_map ( array ( get_called_class ( ) , 'trim_stripslashes_deep' ) , $ value ) ; } elseif ( is_object ( $ value ) ) { $ vars = get_object_vars ( $ value ) ; foreach ( $ vars as $ key => $ data ) { $ value -> { $ key } = self :: trim_stripslashes_deep ( $ data ) ; } } elseif ( is_string ( $ value ) ) { $ value = trim ( stripslashes ( $ value ) ) ; } return $ value ; }
Provides a replacement for WP's native stripslashes_deep
function, which, frustratingly, doesn't trim

@param $value
@return array|object|string
Provides a replacement for WP s native stripslashes_deep function which frustratingly doesn t trim