CRM-15933 Profile HTML Snippets don't respect CIVICRM_UF_WP_BASEPAGE
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 3 Mar 2015 08:26:46 +0000 (13:56 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 3 Mar 2015 08:26:46 +0000 (13:56 +0530)
CRM/UF/Page/Group.php

index 04c1ba21cc6e8131dda7f81255ee651ef100a54b..84c01faca75911616a6dd042e99dee4855e2a6db 100644 (file)
@@ -242,7 +242,17 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
       $profile = str_replace('/administrator/', '/index.php', $profile);
     }
     elseif ($config->userFramework == 'WordPress') {
-      $profile = str_replace('/wp-admin/admin.php', '/index.php', $profile);
+      //@todo remove this part when it is OK to deprecate CIVICRM_UF_WP_BASEPAGE-CRM-15933
+      if (defined('CIVICRM_UF_WP_BASEPAGE')) {
+        $wpbase = CIVICRM_UF_WP_BASEPAGE;
+      }
+      elseif (!empty($config->wpBasePage)) {
+        $wpbase = $config->wpBasePage;
+      }
+      else {
+        $wpbase = 'index.php';
+      }
+      $profile = str_replace('/wp-admin/admin.php', '/'.$wpbase.'/', $profile);
     }
 
     // add header files