• Documentation
  • Support / Community
  • Products
    • Piklist Framework
    • Toolbox
    • Fields and Forms
    • WordPress Helpers
  • Log In
Piklist

Access your account, and post on the Support Forums

Retrieve Password | Register for account

Topic: Related Content from Postmeta

Support Home » Topics » Piklist » Related Content from Postmeta

Tagged: get_post_meta postmeta

  • This topic has 0 replies, 1 voice, and was last updated 5 years ago by moshemo.
Viewing 0 reply threads
  • Author
    Posts
    • January 22, 2017 at 1:06 pm #7742
      moshemo
      Member

      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.

  • Author
    Posts
Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Log In

Log in / Register

Register for an Account

Stay up-to-date with Piklist

About

  • Philosophy
  • Privacy Policy
  • Terms of Service
  • Contact Us
  • Register for an account

Resources

  • Community Forums
  • Documentation
  • Tutorials
  • Get involved

Follow Piklist

  • Like us on Facebook
  • Follow us on Twitter
  • Connect on Google +
  • Watch on YouTube

Rate Piklist


If you love Piklist leave us a 5 Star review on WordPress.org.

News

  • Piklist v0.9.9.8 is now available

    September 30, 2019

    In October of 2015, we released v0.9.9 of Piklist. Your help in testing lead to seven(7) m ...

  • Piklist is now on HackerOne

    September 30, 2019

    We built Piklist from the ground up with security as our top priority. While we’ve t ...

  • Read all News
  • Powered by Piklist & WordPress © 2009 – 2022 Piklist LLC.
    This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to the use of cookies. Find out more.