› Forums › SNAP – WordPress Plugin Forums › How metadata are stored in the db?
- This topic has 2 replies, 1 voice, and was last updated 13 years ago by
NextScripts.com.
- AuthorPosts
- April 19, 2013 at 2:19 am #14024
Dext
ParticipantI try to read metadata written by SNAP (directly from “postmeta” table of wordpress database) to include the date of last publish to different social site (several blogspot, several google+, ecc ecc) in my reports (that show statistics about every plugin i use).
Sometimes, i just need to unserialize (with PHP function unserialize() ) twice to get a valid array in wich i find the ‘pDate’ attribute (what i need). Sometimes instead, strings seem to be invalid serialized data… but the plugin can still read the correct date (i can see it in my /wp-admin control panel).
It’s possible to know exactly how metadata are stored in “postmeta” table of wordpress database?
thanks,
Dext
April 19, 2013 at 5:44 am #14029Carol
ParticipantI have the same question too! How can i read directly from postmeta table? i mean, metadata whit meta_key ‘snap-BG’,’snap-GP’, ecc ecc
thanks in advance
April 19, 2013 at 8:35 am #14038Just use WordPress functions.
$postMeta = maybe_unserialize(get_post_meta($post_id, ‘snapFB’, true));
- AuthorPosts
- You must be logged in to reply to this topic.
