Definition:
function maybe_serialize( $data ) {}
Serialize data, if needed.
Parameters
- mixed $data: Data that might be serialized.
Return values
returns:A scalar data
Source code
function maybe_serialize( $data ) {
if ( is_array( $data ) || is_object( $data ) )
return serialize( $data );
// Double serialization is required for backward compatibility.
// See http://core.trac.wordpress.org/ticket/12930
if ( is_serialized( $data ) )
return serialize( $data );
return $data;
}
2337

February 12, 2011 


No comments yet... Be the first to leave a reply!