Skip to content

Commit

Permalink
Additional check for pll_current_language()
Browse files Browse the repository at this point in the history
  • Loading branch information
samiahmedsiddiqui committed Jun 11, 2019
1 parent d7b7df7 commit 48c401a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/class-custom-permalinks-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,14 @@ public function custom_permalinks_check_conflicts( $requested_url = '' ) {
* If true the remove the lang code from the url.
*/
if ( 1 == $polylang_config['hide_default'] ) {
// get current language
$current_language = pll_current_language();
$current_language = '';
if ( function_exists( 'pll_current_language' ) ) {
// get current language
$current_language = pll_current_language();
}

// get defualt language
$default_language = pll_default_language();
$default_language = $polylang_config['default_lang'];

if ( $current_language !== $default_language ) {
$remove_lang = ltrim( strstr( $requested_url, '/' ), '/' );
Expand Down

0 comments on commit 48c401a

Please sign in to comment.