Outil de recherche WordPress pour les développeurs et auteurs de thèmes



maybe_unserialize ›

Depuis2.0.0
Dépréciéen/a
maybe_unserialize ( $original )
Paramètres:
  • (string) $original Maybe unserialized original, if is needed.
    Requis: Oui
Retourne:
  • (mixed) Unserialized data can be any type.
Défini(e) dans:
Codex:

Unserialize value only if it was serialized.



Source

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