API Retirement Banner fix
-
This will fix the dismiss problem of the retirement banner. This works for me. However please test and take preclusions when editing files directly. Enjoy!
Append this directly to the end of
USPS-simple-shipping.php. This bypasses the broken JavaScript enqueue process and manually sets the exact site transient the plugin is looking for (uspssimple-retirement-notice).// --- USPS Simple Notice Hotfix ---
add_action('wp_ajax_usps_simple_force_dismiss', function() {
set_site_transient('uspssimple-retirement-notice', true, 0);
wp_die();
});
add_action('admin_footer', function() {
if (get_site_transient('uspssimple-retirement-notice')) {
return;
}
?>
<script>
jQuery(document).ready(function($) {
// Use event delegation to catch the click before WP core removes the element
$(document).on('click', '.notice[data-dismissible="uspssimple-retirement-notice"] .notice-dismiss', function() {
$.post(ajaxurl, {
action: 'usps_simple_force_dismiss'
});
});
});
</script>
<?php
});
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.