{"id":2679,"date":"2020-12-14T04:54:40","date_gmt":"2020-12-14T04:54:40","guid":{"rendered":"https:\/\/www.nathankowald.com\/blog\/?p=2679"},"modified":"2021-07-15T04:13:19","modified_gmt":"2021-07-15T03:13:19","slug":"allow-create-and-update-feeds-with-the-gravity-forms-user-registration-add-on-plugin","status":"publish","type":"post","link":"https:\/\/www.nathankowald.com\/blog\/2020\/12\/allow-create-and-update-feeds-with-the-gravity-forms-user-registration-add-on-plugin\/","title":{"rendered":"Allow Create and Update feeds with the Gravity Forms User Registration Add-On plugin"},"content":{"rendered":"\n<p>The <a href=\"https:\/\/www.gravityforms.com\/add-ons\/user-registration\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Gravity Forms User Registration Add-On plugin<\/a> allows you to Create (or Update) a WordPress user and their meta fields from a Gravity Form&#8217;s fields. It&#8217;s a great plugin.<\/p>\n\n\n\n<p>By default, it only allows one feed type per form: a <strong>Create<\/strong> OR an <strong>Update<\/strong> feed.<\/p>\n\n\n\n<p>I build a lot of Membership Application forms with Gravity Forms. I used to build two forms per User Registration feed: one for logged-out users and another for logged-in users. It was annoying for me and our clients to maintain two forms.<\/p>\n\n\n\n<p>I spent some time seeing if I could use both a <strong>Create<\/strong> and <strong>Update<\/strong> feed on one form, triggering one or the other feed based on a user&#8217;s log-in state. <br>I found a way to do it. I&#8217;m sharing the code in case it&#8217;s useful to anyone.<\/p>\n\n\n\n<p>To use this code, copy the class into a plugin (or your theme). Then call gravity_forms_user_registration::init() from an action such as &#8216;plugins_loaded&#8217;.<\/p>\n\n\n<script src=\"https:\/\/gist.github.com\/n8kowald\/1ca0e5985c6a95106e05788ade0c1724.js\"><\/script>","protected":false},"excerpt":{"rendered":"<p>The Gravity Forms User Registration Add-On plugin allows you to Create (or Update) a WordPress user and their meta fields from a Gravity Form&#8217;s fields. It&#8217;s a great plugin. By default, it only allows one feed type per form: a Create OR an Update feed. I build a lot of Membership Application forms with Gravity [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2742,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7,33],"tags":[],"class_list":["post-2679","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","category-wordpress"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/2679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/comments?post=2679"}],"version-history":[{"count":5,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/2679\/revisions"}],"predecessor-version":[{"id":2686,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/2679\/revisions\/2686"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/media\/2742"}],"wp:attachment":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/media?parent=2679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/categories?post=2679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/tags?post=2679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}