From eea70e806ac330815136c9e7ef7fb1b4e06daaa6 Mon Sep 17 00:00:00 2001 From: Christian Wach Date: Thu, 2 Apr 2020 19:27:56 +0100 Subject: [PATCH] Revert "Support polylang language prefixes with clean URLs" --- civicrm.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/civicrm.php b/civicrm.php index 0418f25..8a86a59 100644 --- a/civicrm.php +++ b/civicrm.php @@ -797,19 +797,7 @@ public function rewrite_rules( $flush_rewrite_rules = false ) { return; } - // Let's add rewrite rule when viewing the basepage(s) - if ( function_exists( 'pll_languages_list' ) ) { - // Support polylang language prefixes - eg. ^(?:en/|pt/|) - $languages = pll_languages_list(); - foreach ( $languages as $language ) { - $postID = pll_get_post( $basepage->ID, $language ); - add_rewrite_rule( - "^{$language}/" . $config->wpBasePage . '/([^?]*)?', - 'index.php?page_id=' . $postID . '&page=CiviCRM&q=civicrm%2F$matches[1]', - 'top' - ); - }; - } + // Let's add rewrite rule when viewing the basepage add_rewrite_rule( '^' . $config->wpBasePage . '/([^?]*)?', 'index.php?page_id=' . $basepage->ID . '&page=CiviCRM&q=civicrm%2F$matches[1]',