Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Gravity Forms Update post meta from template [closed]

Here’s the repair, for good measure and anyone curious:

add_action("gform_after_submission_5", "books_promoter", 10, 4);
function books_promoter($entry, $form) {
        global $post;
        global $wp_query;

        $post_id = get_the_ID(); // $entry['post_id'];

        $post_data['status'] = get_post_meta($post_id,'status', true);
        $post_data['promoter'] = get_post_meta($post_id,'promoter', true);

        $status = $entry['5'];
        $promoter = $entry['6'];

        update_post_meta($post_id, 'books_status', $status );
        update_post_meta($post_id, 'books_promoter', $promoter );
}

Related Posts:

  1. Custom post meta field effect on the performance on the post
  2. Difference between meta keys with _ and without _ [duplicate]
  3. Orderby meta_value only returns posts that have existing meta_key
  4. How to enable revisions for post meta data?
  5. Best way to programmatically remove a category/term from a post
  6. When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
  7. Storing meta fields multiple times OR once with multi dimensional array?
  8. display specific custom fields
  9. passing argument to get_template_part() or a better way to code
  10. Is it possible to store arrays in a custom field?
  11. Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post
  12. importing data from non-wordpress mysql db
  13. Create meta boxes that don’t show in custom fields
  14. Transients vs CRON +Custom Fields: Caching Data Per Post
  15. Unable to save datetime custom meta field using update_post_meta() function
  16. Create custom field on post draft or publish?
  17. get_post_meta fields don’t show up on posts page
  18. copy attachments to another post type and change attachment url
  19. Cannot edit post meta fields with rest API
  20. Copying Custom Meta Values from existing post to a duplicate post
  21. Add a post meta key and value only if it does not exist on the post
  22. Move value of one custom field to another
  23. Order posts according to user defined order for meta values?
  24. Displaying posts with only upcoming dates according their custom field date value
  25. Custom fields: In what order are they saved into the DB?
  26. Function to change meta value in database for each post
  27. Get a post_id where meta_value equals something in a serialized meta_value field
  28. Get aggregate list of all custom fields for entire blog
  29. How to save a ToggleControl value in a meta field?
  30. using multiple meta_key and meta_value in query_posts
  31. How can I sort homepage by a meta value?
  32. Get specific custom field keys from a post and put into an array
  33. MySQL Query that looks for post with Custom Field, then changes Category
  34. ACF: How to get the full field name (meta_key) by a field key?
  35. Create Multiple File Upload Metabox in WordPress
  36. filtering custom post types via meta data drop down
  37. How to add a new meta key and assign timestamp to posts
  38. If meta key exists in get posts function otherwise create it
  39. Read / Watch / Listen times – meta
  40. How do I Implement Atomic Update of Post Metadata?
  41. How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
  42. Why is my Custom Meta Box Field Inputs NOT saving?
  43. Get registered custom fields or post meta even if empty
  44. Displaying multiple URLs as custom field values
  45. get_posts in meta box dropdown not showing latest posts
  46. Limits, not all post are showen when querying for posts by view count
  47. Display Custom Meta Box Field Only If Value is Present
  48. Ordering posts by custom field named “date” in backend
  49. Unique meta_key with array value vs repeated meta_key with single values
  50. Allow only one post with specific meta value
  51. How to validate select field in post meta?
  52. How to display childrens custom fields?
  53. how to display custom fields of post on a web page
  54. How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)
  55. How to fill custom fields with brackets in their key with add_post_meta()?
  56. Looping inside block return
  57. change order of images attached to post
  58. how can I show name and value of Custom Fields together?
  59. Best way to achieve multiple links in a post title
  60. How can I add/update post meta in a admin menu page?
  61. Custom Field & Gravity Forms [closed]
  62. Get author total post votes from post meta
  63. custom filed from post in the side bar
  64. wordpress multi user question
  65. How to display custom fields in hestia theme
  66. Adding Custom Metadata to my Archive/Posts page
  67. How to improve my non-unique metadata MySQL entries?
  68. How to speed up post list slowed by update_meta_cache()?
  69. WordPress Blocks, setAttributes not saving
  70. Custom Fields Not Showing (ACF not installed)
  71. SQL query to change the value of a Custom Field
  72. Custom meta POST request fired twice when updating a post in Gutenberg
  73. Add custom field information to source meta data
  74. How do I update custom field post meta in frontend post template?
  75. Update custom field on page specific to logged in user
  76. How to Find List of Available Custom Fields for Theme?
  77. Create Meta boxes dynamically
  78. Custom Fields Not Working In Footer
  79. ACF plugin and field update
  80. Delete custom meta
  81. Check if value exists before saving
  82. Get meta value when the page is a blog archive
  83. Search one custom field?
  84. Can’t save meta field value if the title not set
  85. Adding custom fields to images
  86. How to save dynamically generated value in post type?
  87. wordpress simple post multi rating with post_meta and user_meta
  88. wp_postmeta are updated for only one page
  89. how to show this part only in the single post page?
  90. Display meta data from a custom field within plugin Category Grid View Gallery
  91. Custom fields / meta box output
  92. If post custom meta data is not set, show normal state
  93. Colecting values from custom field checkboxes and displaying them in the post
  94. Build Array from Input Fields question
  95. custom field with links
  96. How can i put a custom field inside this php
  97. How to add new Metadata options (Date, Author, etc.) for Posts?
  98. WP Query Args – search by meta_key or title
  99. Saving multiple custom meta box fields
  100. Search for meta_query does not return any result if combined with title
Categories custom-field Tags custom-field, plugin-gravity-forms, post-meta
How to retrive Custom Post Type Meta Fields in Custom WP_Query
Including php file in directory above WordPress installation

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress