Commit cb7fa361 authored by totten's avatar totten

CRM-16421 - Convert constants to `$civicrm_paths`

parent ca8e5ddc
......@@ -1427,25 +1427,12 @@ class CiviCRM_For_WordPress {
*/
public function get_base_url($absolute, $frontend, $forceBackend) {
$config = CRM_Core_Config::singleton();
if (!defined('CIVICRM_UF_ADMINURL')) {
define('CIVICRM_UF_ADMINURL', CIVICRM_UF_BASEURL . 'wp-admin/');
}
if (!defined('CIVICRM_UF_WP_BASEURL')) {
define('CIVICRM_UF_WP_BASEURL', CIVICRM_UF_BASEURL );
}
if ((is_admin() && !$frontend) || $forceBackend) {
$url = CIVICRM_UF_ADMINURL . 'admin.php';
return $url;
return Civi::paths()->getUrl('[wp.backend]/.', $absolute ? 'absolute' : 'relative');
}
elseif (defined('CIVICRM_UF_WP_BASEPAGE')) {
$url = CIVICRM_UF_WP_BASEURL . CIVICRM_UF_WP_BASEPAGE ;
return $url;
}
elseif (isset($config->wpBasePage)) {
$url = CIVICRM_UF_WP_BASEURL . $config->wpBasePage;
return $url;
else {
return Civi::paths()->getUrl('[wp.frontend]/.', $absolute ? 'absolute' : 'relative');
}
return $absolute ? $url : preg_replace(';https?://[^/]+/;', '/', $url);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment