Prevent "add_action" from being called multiple times
authorChristian Wach <needle@haystack.co.uk>
Fri, 27 Nov 2020 15:03:06 +0000 (15:03 +0000)
committerChristian Wach <needle@haystack.co.uk>
Fri, 27 Nov 2020 15:03:06 +0000 (15:03 +0000)
CRM/Utils/System/WordPress.php

index 2877ffed2ad9faaa5575732ac599da8835c932c6..98cb5a88fd8a9fadab1e872a04a57a30b26af718 100644 (file)
@@ -271,6 +271,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
       add_action('wp_head', [__CLASS__, '_showHTMLHead']);
       // back-end views
       add_action('admin_head', [__CLASS__, '_showHTMLHead']);
+      $registered = TRUE;
     }
     CRM_Core_Region::instance('wp_head')->add([
       'markup' => $head,