From 8dc1f42ab438d118d28ae73245843fc5db7a7bf3 Mon Sep 17 00:00:00 2001 From: Israel Martins Date: Wed, 10 Jul 2024 18:03:05 +0100 Subject: [PATCH] Added form submit event listener Wrapped cookie trigger and popup close timeout within a form submit event callback. --- ...popup-and-create-cookie-on-form-submit.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/On_Form_Submit_Actions/close-popup-and-create-cookie-on-form-submit.php b/On_Form_Submit_Actions/close-popup-and-create-cookie-on-form-submit.php index cd60ac7..6aa1415 100644 --- a/On_Form_Submit_Actions/close-popup-and-create-cookie-on-form-submit.php +++ b/On_Form_Submit_Actions/close-popup-and-create-cookie-on-form-submit.php @@ -4,28 +4,38 @@ * 'functions.php' file starting with 'add_action()'. * -------------------------------------------------------------------------- */ add_action( 'wp_footer', 'my_custom_popup_scripts', 500 ); + /** * Add custom JS script to footer to set a cookie that targets a popup by it's ID. * * Note: Popups are assigned a unique ID of '#popmake-{integer}'. * From the WP Admin, view 'Popup Maker' -> 'All Popups' -> 'CSS Classes (column)' * to locate the popup ID formatted as 'popmake-{integer}'. Change the placeholder - * ID ( '#popmake-967' ) in this code sample with your site's unique popup ID. + * ID ( '#popmake-967' and '#pum-967' ) in this code sample with your site's unique popup ID. * * @since 1.0.0 * * @return void */ -function my_custom_popup_scripts() { ?> - +