Skip to content

Commit

Permalink
Merge pull request #189 from civicrm/revert-176-cleanurls_polylang
Browse files Browse the repository at this point in the history
Revert "Support polylang language prefixes with clean URLs"
  • Loading branch information
christianwach authored Apr 2, 2020
2 parents 7c9df15 + eea70e8 commit 0582c79
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions civicrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]',
Expand Down

0 comments on commit 0582c79

Please sign in to comment.