CRM-15629, during exten/* calls we don't bootstrap hence some constants are not availble.
authorkurund <kurund@civicrm.org>
Fri, 17 Apr 2015 05:51:56 +0000 (22:51 -0700)
committerkurund <kurund@civicrm.org>
Fri, 17 Apr 2015 05:51:56 +0000 (22:51 -0700)
----------------------------------------
* CRM-15629: Paypal IPN not working on Wordpress the first time
  https://issues.civicrm.org/jira/browse/CRM-15629

CRM/Core/Permission/WordPress.php

index 79bfefa3dadf49ad125a482c7d5d9c45442d8a05..509a5897af82012aa22260994e2fd8c87ecf659d 100644 (file)
@@ -58,6 +58,13 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base {
       return TRUE;
     }
 
+    // During some extern/* calls we don't bootstrap CMS hence
+    // below constants are not set, so those cases, we don't need to
+    // check permission, hence return TRUE
+    if (!defined('ABSPATH') || !defined('WPINC')) {
+      return TRUE;
+    }
+
     require_once ABSPATH . WPINC . '/pluggable.php';
 
     // for administrators give them all permissions