Uma área de pesquisa sobre o WordPress para devs e autores do tema



maybe_unserialize ›

Desde2.0.0
Obsoleton/a
maybe_unserialize ( $original )
Parâmetros:
  • (string) $original Maybe unserialized original, if is needed.
    Required: Yes
Retorna:
  • (mixed) Unserialized data can be any type.
Definido em:
Codex:

Unserialize value only if it was serialized.



Fonte

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;
}