maybe_serialize [ WordPress Function ]
maybe_serialize ( $data )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: maybe_unserialize, is_serialized, image_resize, is_serialized_string, add_image_size
Serialize data, if needed.
Source
<?php
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;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/maybe serialize « WordPress Codex
Description. Serialize data, if needed. Usage. <?php maybe_serialize( $data ); ? > Parameters. $data: (mixed) (required) Data that might be serialized. Default: ...
codex.wordpress.org - WordPress › Support » maybe_serialize() allows corrupted data?
I ran into an issue recently where a plugin which stored all of its values in a serialized array in a single option blew up on me, which nearly caused the loss of lots ...
wordpress.org - WordPress › Support » maybe_serialize( ) - a question about the code
Inside functions.php : function maybe_serialize( $data ) { if ( is_array( $data ) || is_object( $data ) ) return serialize( $data ); if ( is_serialized( $data ) ) return ...
wordpress.org - Maybe_Serialize and the Magic of Wordpress | Code Garage Blog
Mar 27, 2009 ... As you may have noticed in a post I made a few days ago about widetizing wordpress plugins, I mentioned that we needed to serialize our ...
codegarage.com