• 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: How to update post meta using a function

Support Home » Topics » Piklist » How to update post meta using a function

Tagged: postmeta

  • This topic has 1 reply, 2 voices, and was last updated 4 years, 9 months ago by Jason.
Viewing 1 reply thread
  • Author
    Posts
    • April 25, 2017 at 3:30 am #7979
      nasirzia
      Participant

      Hi,
      I have a large number of meta fields stored under a post, i want to update values through code just like
      update_post_meta(123,'metakey', 'metavalue')

      But that doesn’t seems to be working fine. because fields are not saved in postmeta as plain..

    • April 25, 2017 at 6:50 pm #7985
      Jason
      Keymaster

      You’ve got the right idea, but it really depends on the field you’re trying to update. Everything stores simply in the database with the exception of group repeater fields which store as serialized data, which you’ll probably want to pull the array, modify it, and then update using the new array.

      Hope this helps! 🙂

  • Author
    Posts
Viewing 1 reply thread
  • 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.