From e91dd787e36d701ee5fd749eecc31710e1aa6eeb Mon Sep 17 00:00:00 2001 From: nganivet Date: Thu, 29 Sep 2016 12:50:04 -0400 Subject: [PATCH] Fix for 4.6 (#9111) * Fix for 4.6 (a few other places but non-important / too complex to refactor). * Corrects styling * Fix style warning --- CRM/Core/Config/Defaults.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Config/Defaults.php b/CRM/Core/Config/Defaults.php index 40b7910df0..a017330e97 100644 --- a/CRM/Core/Config/Defaults.php +++ b/CRM/Core/Config/Defaults.php @@ -148,7 +148,12 @@ class CRM_Core_Config_Defaults { $defaults['userFrameworkResourceURL'] = $baseURL . "components/com_civicrm/civicrm/"; } elseif ($config->userFramework == 'WordPress') { - $defaults['userFrameworkResourceURL'] = $baseURL . "wp-content/plugins/civicrm/civicrm/"; + if (defined('CIVICRM_PLUGIN_URL')) { + $defaults['userFrameworkResourceURL'] = CIVICRM_PLUGIN_URL . "civicrm/"; + } + else { + $defaults['userFrameworkResourceURL'] = $baseURL . "wp-content/plugins/civicrm/civicrm/"; + } } else { // Drupal setting @@ -200,7 +205,13 @@ class CRM_Core_Config_Defaults { } elseif ($config->userFramework == 'WordPress') { //for standalone no need of sites/defaults directory - $defaults['imageUploadURL'] = $baseURL . "wp-content/plugins/files/civicrm/persist/contribute/"; + if (defined('CIVICRM_PLUGIN_DIR')) { + // CIVICRM_PLUGIN_DIR points to: wp-content/plugins/civicrm/ or similar (with trailing '/') + $defaults['imageUploadURL'] = str_replace('civicrm', 'files/civicrm', CIVICRM_PLUGIN_DIR) . 'persist/contribute/'; + } + else { + $defaults['imageUploadURL'] = $baseURL . "wp-content/plugins/files/civicrm/persist/contribute/"; + } } else { $defaults['imageUploadURL'] = $baseURL . "sites/default/files/civicrm/persist/contribute/"; -- 2.25.1