Update the action for cookie popup
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 8 Oct 2019 20:21:21 +0000 (16:21 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 8 Oct 2019 20:21:21 +0000 (16:21 -0400)
Need to use wp_footer action.

index.php

index cb55607..1ac9154 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -169,7 +169,7 @@ function glmServerStatsScripts()
  */
 
 // If this is an admin request and the cookie pop-ups have been enabled - Popup test in scripting on page
-if ((!empty($_REQUEST['force_cookie']) || $websiteSettings['show_cookie_popup']) && !is_admin()) {
+if ( ( !empty( $_REQUEST['force_cookie'] ) || $websiteSettings['show_cookie_popup'] ) && !is_admin() ) {
 
     // Make sure that the jQuery scripts are included
     function enqueueJquery() {
@@ -179,9 +179,9 @@ if ((!empty($_REQUEST['force_cookie']) || $websiteSettings['show_cookie_popup'])
 
     // Have WordPress include the cookie pop-up code just before the footer.
     function doCookiePopUp() {
-        include(GLM_SERVERSTATS_PLUGIN_MODEL_PATH.'/frontCookiePopUp.php');
+        include GLM_SERVERSTATS_PLUGIN_MODEL_PATH . '/frontCookiePopUp.php';
     }
-    add_action( 'get_footer', 'doCookiePopUp' );
+    add_action( 'wp_footer', 'doCookiePopUp' );
 
 }