There are cases when you want to allow your site visitors to add content to your WordPress blog from a front end form. The best (and easiest) way to accomplish this is to use Gravity Forms and our Gravity Forms + Custom Post Types Addon. For those that don’t know, the addon allows your site visitors to capture custom post types from a front end Gravity Form.
So if your form is creating posts in your WordPress database, do you really need the form to also create an entry? (or a lead as it’s called in the Gravity Forms code). I think in most cases not.
Someone also asked me if I could stop Gravity Forms from creating these entry database records, so I looked into it. I could not find a way, using the existing Gravity Forms hooks, to stop the form from creating an entry/lead in the database.
2 things to note with the code:
- line 2 has a syntax error and has an unnecessaryparenthesis ‘)’
So now the question: Should I create a small plugin that does this? And include a settings page where you can configure which forms delete their entries/leads?