• Resolved chromaside

    (@chromaside)


    Hello!

    Working with the Forminator plugin to run polls for our News website. It works great, but I did run into a problem – when a user votes on a poll, instead of the page reloading it redirects to a 404.

    However, I can bypass this issue by having polls reload using AJAX – which is set in behaviour settings under Submission Method.

    My question – can I setup the plugin to DEFAULT to the Ajax submission method? I see appearance defaults but nothing for behaviour.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @chromaside !

    Hope you’re doing great today!

    At the moment we don’t have a setting to set the default submission behaviour so it would have to be set manually each time for new polls.

    However, I’ve asked our Second Line Support team to check if it would be possible to override that with a snippet. We’ll share feedback here as soon as we hear back from them.

    Warm regards,
    Pawel

    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @chromaside !

    Good news, it’s possible to set that using a small snippet:

    <?php
    
    add_filter( 'forminator_poll_settings', 'wpmudev_update_poll_behavior', 10, 4 );
    function wpmudev_update_poll_behavior( $form_settings, $model, $data, $cls ){
    	if( $model->status == 'draft' && !($model->behaviors) ){
    		if( !isset( $form_settings['enable-ajax'] ) ){
    			$form_settings['enable-ajax'] = 'true';
    		}
    	}
    	return $form_settings;
    }

    I’ve tested it on my testing site and it worked correctly. It will set all newly created polls to reload using Ajax.

    To install the snippet:
    – copy the code to a .php file with any name
    – upload the file to wp-content/mu-plugins/ directory (create if doesn’t exist)
    – test by creating a new poll

    Warm regards,
    Pawel

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @chromaside

    We haven’t heard from you for several days now, so it looks like you don’t need our assistance anymore.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Default settings for behaviour’ is closed to new replies.