Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Detect WP_Error returned by bbl_get_post_lang_code and bomb out, rath…

…er than treating it as the actual lang and breaking later. Fixes #74
  • Loading branch information...
commit f68a8f40ae68a056eeda8006e670b66c2507d7d5 1 parent 8fffabe
@simonwheatley simonwheatley authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  miscellaneous.php
View
2  miscellaneous.php
@@ -43,6 +43,8 @@ function bbl_admin_init() {
}
} else {
$post_lang_code = bbl_get_post_lang_code( $post_id );
+ if ( is_wp_error( $post_lang_code ) )
+ return;
if ( $post_lang_code != $cur_lang_code ) {
$url = add_query_arg( array( 'lang' => $post_lang_code ) );
wp_redirect( $url );
Please sign in to comment.
Something went wrong with that request. Please try again.