advancedforms / advanced-forms

WordPress plugin to create forms using Advanced Custom Fields
75 stars 14 forks source link

adds a field for Form Class, under Display tab #21

Closed gamma613 closed 6 years ago

fabianlindfors commented 6 years ago

Thanks for creating a PR!

I would rather try to keep the form settings as lean as possible which also include any visual settings such as class. Preferably one should update these things through hooks instead which offer more power.

I have added new hooks for after an entry has been created. I hadn't pushed it to Github yet but I fixed that now. Available in commit 9f884eafd0c70eae8e7daf22a87f14540242365e.

Thank you for taking the time to suggest and implement these changes. Much appreciated regardless if included or not!

gamma613 commented 6 years ago

Thanks for adding the hooks for create_entry - much obliged!

Regarding the ability to add a class to the form, the concern with using hooks is that less experienced users might not know how to implement this. Using the filters also requires that we know the ID of the form(s) in question, which is often inconvenient (ex: if the theme was set up by an coder, and the site's manager needs to be able to dynamically create forms and assign specific classes)

fabianlindfors commented 6 years ago

I totally see what you mean and hooks are definitely not as beginner-friendly as a setting. I'll stick to my stance on no display related settings for now but may rethink it in the future if more people request similar things.

If you'd like to create a small companion plugin I'd be happy to promote it and list it in the documentation!