From 25bd5735a388e8fc2e107434b1cf05adcab65840 Mon Sep 17 00:00:00 2001 From: Christian Wach Date: Tue, 19 May 2020 11:39:22 +0100 Subject: [PATCH] Remove "page=CiviCRM" query string from WordPress front-end --- CRM/Utils/System/WordPress.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 715b05b280..873020ce53 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -253,7 +253,13 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { // pre-existing logic if (isset($path)) { - $queryParts[] = 'page=CiviCRM'; + // Admin URLs still need "page=CiviCRM", front-end URLs do not. + if ((is_admin() && !$frontend) || $forceBackend) { + $queryParts[] = 'page=CiviCRM'; + } + else { + $queryParts[] = 'civiwp=CiviCRM'; + } $queryParts[] = 'q=' . rawurlencode($path); } if ($wpPageParam) { -- 2.25.1