Last active
August 9, 2024 10:00
-
-
Save wpmudev-sls/5a773a44efad47e22a0195574c9e6a36 to your computer and use it in GitHub Desktop.
[Forminator Pro] - Fix signature resize issue 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] 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