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



maybe_unserialize › WordPress Function

Desde2.0.0
Obsoleton/a
maybe_unserialize ( $data )
Parâmetros:
  • (string) $data Data that might be unserialized.
    Required: Yes
Retorna:
  • (mixed) Unserialized data can be any type.
Definido em:
Codex:

Unserializes data only if it was serialized.



Fonte

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

	return $data;
}