Skip to content

Commit

Permalink
Merge pull request #29 from thomasblanchard-dev/v3.0
Browse files Browse the repository at this point in the history
🐛 Debug Polylang in admin
  • Loading branch information
amostajo committed Jul 21, 2022
2 parents f44dc7b + ec65811 commit e527238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/functions.php
Expand Up @@ -81,7 +81,7 @@ function assets_url( $path, $file, $scheme = null, $is_network = false )
// Polylang support
if ( function_exists( 'pll_current_language' ) ) {
$lang = pll_current_language( 'slug' );
if ( strpos( $url, '/' . $lang ) !== false)
if ( strpos( $url, '/' . $lang ) !== false && $lang !== false )
$url = str_replace( '/' . $lang, '', $url );
}
// WPML support
Expand Down Expand Up @@ -216,4 +216,4 @@ function theme_view( $key, $params = [] )
if ( Resolver::exists( 'theme' ) )
Resolver::get( 'theme' )->view( $key, $params );
}
}
}

0 comments on commit e527238

Please sign in to comment.