php - get_post_meta() returning an arrary when it shouldn't -
why using get_post_meta()
of sudden start returning array when $single
set true?
$sync = get_post_meta( $pid, '_subscription_sync', true ); if ( 'yes' != $sync ) return;
var_dump($sync)
returns this: array(1) { [0]=> string(3) "yes" }
is there global setting i'm not aware off?
you have saved array database. update_post_meta automatically serializes you. $single setting on get_post_meta refers whether pull entries post id , key..
var_dump variable saving before update_post_meta , check how ending array.
Comments
Post a Comment