Set Registered User as Post Author
Here’s a little story and a little tip. I was recently speaking with a friend (yes, wizards do have friends) and he was sharing some of the requirements for a site he was working on.
This site needed to have a form that would allow users to submit posts (aka content) to the site, register the user and then make sure the newly registered user was properly attributed as the author of the submitted post.
He was estimating that it would take about 8 – 10 hours to build such functionality. I was very happy to point him to Gravity Forms. He was ecstatic! It took him 30 minutes from start to finish to install and configure his form with Gravity Forms plus the User Registration Add-on! The only piece he was a little confused by was how to set the registered user as the post’s author.
Easy enough! After you’ve added at least one Post field to your form, a new option to “Set as Post Author” will appear on the User Registration feed settings for that form. Check “Enable” and the registered user will automatically be set as the author of the created post.
Hey David, I followed above steps but it’s not working for me.
Hi Bakhtawar, this tutorial demonstrates default Gravity Forms functionality. I’d recommend reaching out to the Gravity Forms support team if you’re having any issues.
http://gravityhelp.com/support/
Hello Wiz,
Its really helpful for me. But I’m finding a thing now a days that can we use a name from submit form and show that name where author details are displaying in GF I saw only two options that “Default Post Author” and “Use logged in user as author” but If my blogger not registered than how can I show his details or name from submit form?
~Jiten
Hi Jiten, there are two solutions.
1 – You can use the GF User Registration add-on and register the user as an author when they submit their post. 2 – You can store the user’s name in a Custom Field and modify your theme to output the author’s name if found and if not, output the custom field value.
Thank You David. I’ll try it :)
Thx David, this tip saved me a lot of time.
Glad to help! :)
David – Would love to know what your response was to Tommy’s question:
Hi Chris, I sent him this: http://wordpress.org/extend/plugins/wp-hide-dashboard/ Hope it works for you as well. :)
Thanks David! It turns out that my biggest source of confusion was how to allow a registered user to log into WordPress, without actually giving him access to the wp dashboard. It looks like I need to use something like the Members plugin to restrict access (unless you know of a better way solution).
Thanks David– your posts are very helpful, and especially this one. However, the challenge I now have is that registered users who attempt to submit a new post, can’t. They get an error message: “This username is already registered.” Is there a way to prevent this from happening?
Hi Tommy, give this a shot:
https://gravitywiz.com/2012/04/24/skip-user-registration-for-logged-in-users/
Hey, Wiz! Just found your site via @carlhancock, and am looking forward to keeping up with your tips! (I’ll be using this one as I rebuild my own site – thanks!)
(Just a note on the site:Â the excerpt for this post reads, in part, “This site needed to have a form that would to the site, register the user and then…” Looks like the link was stripped…)
Thanks for pointing that out Andrew. Hope you find the site to be very useful! If you have any suggestions for improvement and or ideas for snippets please do let me know. :)