Skip to content

Commit

Permalink
Fix - Conflict with TranslatePress
Browse files Browse the repository at this point in the history
  • Loading branch information
lekhnathpandey committed Jul 24, 2023
1 parent 42b4efc commit 922c5f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/functions-ur-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function ur_get_page_id( $page ) {
$translations = pll_get_post_translations( $page );
$page = isset( $translations[ pll_current_language() ] ) ? $translations[ pll_current_language() ] : $page;
}
} elseif ( $page > 0 && has_filter( 'wpml_current_language' ) ) {
} elseif ( $page > 0 && class_exists( 'SitePress', false ) ) {
$page = ur_get_wpml_page_language( $page );
}

Expand Down Expand Up @@ -116,7 +116,7 @@ function ur_get_page_permalink( $page ) {
$translations = pll_get_post_translations( $page_id );
$page = isset( $translations[ pll_current_language() ] ) ? $translations[ pll_current_language() ] : $page_id;
}
} elseif ( $page_id > 0 && has_filter( 'wpml_current_language' ) ) {
} elseif ( $page_id > 0 && class_exists( 'SitePress', false ) ) {
$page = ur_get_wpml_page_language( $page_id );
}

Expand All @@ -140,7 +140,7 @@ function ur_get_login_url() {
$translations = pll_get_post_translations( $my_account_page_id );
$my_account_page_id = isset( $translations[ pll_current_language() ] ) ? $translations[ pll_current_language() ] : $my_account_page_id;
}
} elseif ( $my_account_page_id > 0 && has_filter( 'wpml_current_language' ) ) {
} elseif ( $my_account_page_id > 0 && class_exists( 'SitePress', false ) ) {
$my_account_page_id = ur_get_wpml_page_language( $my_account_page_id );
}

Expand Down Expand Up @@ -170,7 +170,7 @@ function ur_get_my_account_url() {
$translations = pll_get_post_translations( $my_account_page_id );
$my_account_page_id = isset( $translations[ pll_current_language() ] ) ? $translations[ pll_current_language() ] : $my_account_page_id;
}
} elseif ( $my_account_page_id > 0 && has_filter( 'wpml_current_language' ) ) {
} elseif ( $my_account_page_id > 0 && class_exists( 'SitePress', false ) ) {
$my_account_page_id = ur_get_wpml_page_language( $my_account_page_id );
}

Expand Down Expand Up @@ -205,7 +205,7 @@ function ur_get_current_language() {

if ( function_exists( 'pll_current_language' ) ) {
$current_language = pll_current_language();
} elseif ( has_filter( 'wpml_current_language' ) ) {
} elseif ( class_exists( 'SitePress', false ) ) {
$current_language = apply_filters( 'wpml_current_language', $current_language );
}
return $current_language;
Expand Down

0 comments on commit 922c5f4

Please sign in to comment.