Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wpmudev-sls/5a773a44efad47e22a0195574c9e6a36 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/5a773a44efad47e22a0195574c9e6a36 to your computer and use it in GitHub Desktop.
[Forminator Pro] - Fix signature resize issue for paginated forms
<?php
/**
* Plugin Name: [Forminator Pro] Signature resize fix for pagination
* Description: Fixes signature resize issue when navigating through pagination steps instead of next/previous buttons.
* Author: Prashant @ WPMUDEV
* Task: SLS-6382
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
add_action( 'wp_footer', 'wpmudev_signature_resize_paginate', 9999 );
function wpmudev_signature_resize_paginate() {
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');
},500);
$(document).on('after.load.forminator', function(event, form_id) {
if ( 'forminator-module-1945' === event.target.id ) { // Please change 1945 to your form ID.
$(document).on('click', '.forminator-step', function() {
forminatorSignatureResize();
});
}
});
});
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment