advancedforms / advanced-forms

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

Option to disable counting form views #91

Closed vonPiernik closed 2 years ago

vonPiernik commented 3 years ago

Hi guys! It would be nice if we could pass an argument to the shortcode that will disable counting the number of views of the form. It is one update to the database on each request and I would like to be able to avoid it ;) Best regards

fabianlindfors commented 3 years ago

Hi!

This sounds like a good feature to add. Would a filter work? I'm thinking something like: add_filter( 'af/form/should_update_counter', '__return_false()' );.

vonPiernik commented 3 years ago

Hi! Thanks for the reply. Yes, a filter would be awesome ;) Cheers

fabianlindfors commented 3 years ago

Hi, again! I just added a filter for this in 9c2aa4bdf9e0ccfa97b9a1ecdbb839c9236cb973. To disable the view counter for a specific form you can do this: add_filter( 'af/form/view_counter_enabled', '__return_false' );.

Could you check out the plugin from Github and test it out? :)