Title: [Plugin: Gravity Forms &#8211; Update Post] Custom fields not really working
Last modified: August 20, 2016

---

# [Plugin: Gravity Forms – Update Post] Custom fields not really working

 *  [snails07](https://wordpress.org/support/users/snails07/)
 * (@snails07)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/)
 * Awesome plugin, but it appears that updating custom fields is only working intermittently.
   
   The title and body are working fine and update every time but the custom fields
   rarely update. I also have the Gravity Forms + Custom Post Types plugin installed
   and the custom taxonomies never update.
 * [http://wordpress.org/extend/plugins/gravity-forms-update-post/](http://wordpress.org/extend/plugins/gravity-forms-update-post/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [tomdaquino](https://wordpress.org/support/users/tomdaquino/)
 * (@tomdaquino)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756138)
 * I’m using tons of custom taxonomies with my posts which are a custom post type
   and I haven’t seen any issues. Then again maybe I haven’t tested it enough. I’ll
   bang on my forms a bit and see if I can reproduce the issue you are seeing. What
   version of WordPress and Gravity Forms are you using?
 * -Tom
 *  Thread Starter [snails07](https://wordpress.org/support/users/snails07/)
 * (@snails07)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756141)
 * Using the latest version of both. WordPress version 3.3.2 and the Update Post
   plugin version 0.5.2
 *  [tomdaquino](https://wordpress.org/support/users/tomdaquino/)
 * (@tomdaquino)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756143)
 * So I was mistaken. It turns out that I am seeing the same exact problem. I’ll
   spare the details as to why I didn’t recognize the behavior the first time around
   but here’s what I’m seeing now:
 * I’m using a post form with custom post fields to insert data into several wp_postmeta
   fields. I have a separate form that I use to edit the post, including the custom
   post fields. When I update the post, with the edit form, the custom post fields
   create new meta-key/meta-value fields in wp_postmeta instead of editing the existing
   meta-key/meta-value data. That’s actually kind of what I would expect given the
   nature of the wp_postmeta table.
 * So I changed my post form as follows. On each of the custom post fields I checked
   the “Unique Custom Field” checkbox. I did not make any changes to the edit post
   form. When I add a post with the post form everything works fine. If I edit the
   post the original meta-values in the wp_postmeta table are modified instead of
   having new meta-key/meta-value pairs added. It should be problem solved but unfortunately,
   editing the post adds a bunch of unexpected data to the meta-value which totally
   breaks everything (my browser can’t even render the post afterwards). Here’s 
   an example of the meta-key and meta-value before and after an edit:
 * Before edit:
    key value wp_year 2010
 * After edit:
    key value wp_year a:1:{i:0;s:5:”2010″;}
 * If I modify the edit post form and set all of the custom post fields to “Unique
   Custom Field”, I still see the same effect. I have yet to determine why this 
   happens but I’m still testing various configurations.
 * -Tom
 *  [tomdaquino](https://wordpress.org/support/users/tomdaquino/)
 * (@tomdaquino)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756144)
 * Ok, so I got it worked out. You have to set custom fields to “Unique Custom Fields”
   in the Gravity Forms Form Editor if you want to be able edit fields with this
   plugin. In addition, you have to change this line in the Gravity Forms – Update
   Post plugin code:
 * `$meta = get_post_meta($this->post['ID'], $field['postCustomFieldName']);`
 * To
 * `$meta = get_post_meta($this->post['ID'], $field['postCustomFieldName'], true);`
 * This line can be found under the comment “// If a custom field is unique, get
   all the rows and combine them into one”
 * Thanks to dskvr for originally posting this fix here:
    [http://wordpress.org/support/topic/plugin-gravity-forms-update-post-what-does-this-plugin-do?replies=15#post-2848742](http://wordpress.org/support/topic/plugin-gravity-forms-update-post-what-does-this-plugin-do?replies=15#post-2848742)
 * -Tom
 *  Plugin Author [Kevin Miller](https://wordpress.org/support/users/p51labs/)
 * (@p51labs)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756145)
 * Hi Guys-
 * I was actually working on this bug over the weekend and I have submitted an update.
   The patch noted above is close but only fetches one meta value, even if there
   are multiple rows could be in the database. Let me know if anyone has problems
   with the update, I will check in on this thread frequently.
 * Thanks,
 * Kevin
 *  Thread Starter [snails07](https://wordpress.org/support/users/snails07/)
 * (@snails07)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756146)
 * Thanks Kevin, the custom fields all seem to be working now.
 * The custom taxonomies aren’t working properly though. I have checkboxes set up
   for my custom taxonomies and if I check one it saves okay, and then I edit the
   post again and check another taxonomy and this saves. But when I uncheck a taxonomy
   and update the post, it still stays checked.
 * So it works fine to add a taxonomy but not to remove one.
 * Thanks
 *  [Dewey Bushaw](https://wordpress.org/support/users/styledev/)
 * (@styledev)
 * [14 years ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756150)
 * Wanted to hop on the update bandwagon as I have extended this plugin for a client
   to allow for updating gravity forms field type “list”.
 * I was working off version 0.5.2 so I have included a diff to show what I did.
   If you need me to integrate these with v0.5.3 let me know. I should have some
   time later this week.
 * [https://gist.github.com/2830532](https://gist.github.com/2830532)
 *  [dhechler](https://wordpress.org/support/users/dhechler/)
 * (@dhechler)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756207)
 * Hey styledev,
    Did you ever port that fix over to v0.5.3? I’m wondering if there
   is a way to store lists as custom post meta and return that post meta as a list.
   Specifically lists with multiple columns.
 *  [Dewey Bushaw](https://wordpress.org/support/users/styledev/)
 * (@styledev)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756208)
 * No I didn’t but you can get the code from the gist link I put in there.
 * As for a way to store lists as a single custom post meta you would have to write
   custom code to get all list items before they are saved to the database and serialize
   them and store that as a custom post meta, then unserialize it when you retrieve
   it.
 * Thought not sure why you would need to do this as the way lists are saved now
   work fine in terms of storing and pulling.
 *  [dhechler](https://wordpress.org/support/users/dhechler/)
 * (@dhechler)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756209)
 * Styledev,
 * Thanks, i will look at that code.
 * It does work for single column lists, but not for multicolumn lists as it stores
   the multi columns as metavalue = ‘entrycolumnone|entrycolumntwo’. That cannot
   be split and returned into multiple columns.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘[Plugin: Gravity Forms – Update Post] Custom fields not really working’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gravity-forms-update-post_68a432.
   svg)
 * [Gravity Forms - Update Post](https://wordpress.org/plugins/gravity-forms-update-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-update-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-update-post/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-update-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-update-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-update-post/reviews/)

 * 10 replies
 * 5 participants
 * Last reply from: [dhechler](https://wordpress.org/support/users/dhechler/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-update-post-custom-fields-not-really-working/#post-2756209)
 * Status: not resolved