Hello,
I would like to use the relate field with postmeta (as opposed to posts). I am having trouble, though, figuring out how to do that with get_post_meta.
Here is your code:
piklist(‘field’, array(
‘type’ => ‘checkbox’
,’field’ => ‘_’ . piklist::$prefix . ‘relate_post’
,’label’ => __(‘Relate Posts’, ‘piklist-demo’)
,’choices’ => piklist(
get_posts(array(
‘post_type’ => ‘post’
,’numberposts’ => -1
,’orderby’ => ‘title’
,’order’ => ‘ASC’
))
,array(‘ID’, ‘post_title’)
)
,’relate’ => array(
‘scope’ => ‘post’
)
));
How do I modify this so that instead of retrieving a list of posts, I can retrieve a list of items saved in post meta. In my particular case, the meta key is Sections. I want to retrieve all the values with that meta key.
Any idea?
Thanks.