Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Created October 30, 2025 08:51
Show Gist options
  • Save xlplugins/86f4f79f620abe3ccc1fce39529568c7 to your computer and use it in GitHub Desktop.
Save xlplugins/86f4f79f620abe3ccc1fce39529568c7 to your computer and use it in GitHub Desktop.
Fix WFACP Shimmer Animation on Shipping Method Change
add_action('wfacp_internal_css', function() {
?>
<script type="text/javascript">
(function($) {
'use strict';
// Enable shimmer animation trigger for shipping method changes
function enableShimmerTrigger() {
if (window.refresh_page_data_load_trigger === false) {
window.refresh_page_data_load_trigger = true;
$('body').removeClass('wfacp_do_not_show_block');
}
}
// Single delegated event listener for all shipping-related interactions
$(document.body).on('change click', 'input[name^="shipping_method"], .wfacp_shipping_table input, .wfacp_shipping_table label', enableShimmerTrigger);
})(jQuery);
</script>
<?php
}, 999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment