maybe_unserialize( string $original )

Unserialize value only if it was serialized.


Parameters

$original

(Required) Maybe unserialized original, if is needed.


Return

(mixed) Unserialized data can be any type.


Source

File: wp-includes/functions.php

function maybe_unserialize( $original ) {
	if ( is_serialized( $original ) ) // don't attempt to unserialize data that wasn't serialized going in
		return @unserialize( $original );
	return $original;
}


Changelog

Changelog
Version Description
WP-2.0.0 Introduced.