Last active
April 24, 2024 09:51
-
-
Save wpmudev-sls/9a16d5755c2ba4bd6ff27e881a94f466 to your computer and use it in GitHub Desktop.
[Forminator Pro] - Fix submit button visibility for paginated forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: [Forminator Pro] Fix submit button visibility for paginated forms | |
* Description: Fix submit button visibility for paginated forms. | |
* Author: Prashant @ WPMUDEV | |
* Task: SLS-6057 | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} | |
add_action( 'wp_footer', 'wpmudev_fix_pagination_submit_visibility', 9999 ); | |
function wpmudev_fix_pagination_submit_visibility() { | |
global $post; | |
if ( is_a( $post, 'WP_Post' ) && ! has_shortcode( $post->post_content, 'forminator_form' ) ) { | |
return; | |
} | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
setTimeout(function() { | |
$('.forminator-custom-form').trigger('after.load.forminator'); | |
},100); | |
$(document).on('after.load.forminator', function( e, form_id ) { | |
if ( 'forminator-module-2455' == e.target.id ) { // Please change 2455 to your form's ID. | |
$(document).on('forminator.front.pagination.move', function( ev ) { | |
setTimeout(function(){ | |
$('#' + e.target.id).trigger('forminator.front.condition.restart'); | |
},10); | |
}); | |
} | |
}); | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment