﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
13463	post_meta doesn't like objects	tychay		"make an object with data like this

$data = (object) array('primary'=>'blah','data'=>array(1,38243,238,'foo'));[[BR]]
add_post_meta($post_id, 'testmeta', $data);[[BR]]
get_post_meta($post_id, 'testmeta');

You get errors of the sort…
[20-May-2010 16:50:14] PHP Catchable fatal error:  Object of class stdClass could not be converted to string in /home/wpdev/public_html/wp-includes/formatting.php on line 1229[[BR]]
[20-May-2010 16:50:14] PHP Stack trace:[[BR]]
…[[BR]]
[20-May-2010 16:50:14] PHP   4. add_post_meta() [[BR]]
[20-May-2010 16:50:14] PHP   5. add_metadata() /home/wpdev/public_html/wp-includes/post.php:1157 [[BR]]
[20-May-2010 16:50:14] PHP   6. stripslashes_deep() /home/wpdev/public_html/wp-includes/meta.php:54 [[BR]]
[20-May-2010 16:50:14] PHP   7. stripslashes() /home/wpdev/public_html/wp-includes/formatting.php:1229

when deserializing, you get nothing. If you deserialize an array of objects, you'll get an array back where the first value is the serialize with all objects replaced with ""Object"" and subsequent values containing serialized strings of the rest of the content.

(Note: I put this in Post Types because I don't know what component meta is attached to. Please reassign bug if wrong.)
"	defect (bug)	closed	normal		Post Types	3.0	normal	duplicate	add_post_meta, get_post_meta	
