adding function to refresh the golf show form after 5 seconds up on the form
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 10 Feb 2017 19:29:54 +0000 (14:29 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 10 Feb 2017 19:29:54 +0000 (14:29 -0500)
being submitted

functions.php
page.php

index f6f32e6..9b2de02 100644 (file)
@@ -522,7 +522,15 @@ function mountpleasant_empty_cart()
         $woocommerce->cart->empty_cart();
     }
 }
-
+add_action( 'gform_after_submission_17', 'after_submission', 10, 2 );
+function after_submission(){
+    function thankyou_reload(){ ?>
+        <script>
+            var url = window.location.href;
+            setTimeout(function(){window.location = url;} , 5000);
+        </script>
+<?php }
+}
 /* This function exists to remove the content from the top of detail pages of
  * the GLm MemberDB plugin.
  */
index 0cdefec..3ce476a 100644 (file)
--- a/page.php
+++ b/page.php
@@ -1,4 +1,9 @@
 <?php get_header(); ?>
+<?php
+    if( function_exists('thankyou_reload') ){
+        thankyou_reload();
+    }
+?>
 <main class="page-inside">
     <div id="head-img">
         <?php echo glm_get_background(); ?>