Skip to content

Commit

Permalink
Add WPML integration for proper CiviCRM language generation civicrm#133
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneonabike committed Mar 1, 2023
1 parent b3521a8 commit fd19b07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/civicrm.compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function rewrite_rules_wpml($flush_rewrite_rules, $basepage) {
/**
* icl_ls_languages WPML Filter
*
* Modify all CiviCRM URLs to contain the proper language structure based on the WPML settings
* Rewrite all CiviCRM URLs to contain the proper language structure based on the WPML settings
*
* @param array $languages passed by WPML to modify current path
*/
Expand All @@ -245,7 +245,7 @@ public function rewrite_civicrm_urls_wpml($languages) {
// Get CiviCRM basepage slug
$civicrm_slug = apply_filters('civicrm_basepage_slug', 'civicrm');

// Obtain lagnuage negotiation setting
// Obtain WPML lagnuage negotiation setting
$wpml_negotiation = apply_filters('wpml_setting', NULL, 'language_negotiation_type');

// If this is a CiviCRM Page then let's modify the actual path
Expand All @@ -254,7 +254,7 @@ public function rewrite_civicrm_urls_wpml($languages) {
$current_url = explode("?", $_SERVER['REQUEST_URI']);
$civicrm_url = get_site_url(NULL, $current_url[0]);

// Remove lang from path
// Remove language from path
$wpml_negotiation = apply_filters('wpml_setting', NULL, 'language_negotiation_type');
$civicrm_url = $this->wpml_remove_language_from_url($civicrm_url, $sitepress, $wpml_negotiation);

Expand Down

0 comments on commit fd19b07

Please sign in to comment.