do not load theme files when bootstrapping WordPress
authorChristian Wach <needle@haystack.co.uk>
Tue, 10 Nov 2015 10:10:54 +0000 (10:10 +0000)
committerChristian Wach <needle@haystack.co.uk>
Tue, 10 Nov 2015 10:10:54 +0000 (10:10 +0000)
CRM/Utils/System/WordPress.php

index b9ab97211038239c0db69b28507512e38e7ec8cd..bb4b8e721ecf47e8707589428972a8edaa1d584d 100644 (file)
@@ -338,6 +338,10 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   public function loadBootStrap($name = NULL, $pass = NULL) {
     global $wp, $wp_rewrite, $wp_the_query, $wp_query, $wpdb, $current_site, $current_blog, $current_user;
 
+    if (!defined('WP_USE_THEMES')) {
+      define('WP_USE_THEMES', false);
+    }
+
     $cmsRootPath = $this->cmsRootPath();
     if (!$cmsRootPath) {
       CRM_Core_Error::fatal("Could not find the install directory for WordPress");