Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 210725

Polylang Support (PATCH)

$
0
0

Replies: 0

The patch below fixes an error where $language_code is not initialized and other parts of the codebase spew errors into debug.log (when debugging is enabled).

I wouldn’t call this “polylang support” but it’s a fix that solves the case I’m in where polylang has it’s own way of getting at the current language.


diff --git a/wp-content/plugins/ultimate-member/core/um-rewrite.php b/wp-content/plugins/ultimate-member/core/um-rewrite.php
index 0de1526..78a79c8 100644
--- a/wp-content/plugins/ultimate-member/core/um-rewrite.php
+++ b/wp-content/plugins/ultimate-member/core/um-rewrite.php
@@ -52,6 +52,8 @@ class UM_Rewrite {
                                                $language_code = icl_get_current_language();
                                        }else if( function_exists('icl_object_id') && defined('ICL_LANGUAGE_CODE') ){
                                                $language_code = ICL_LANGUAGE_CODE;
+                    }else if( function_exists('pll_current_language') ){^M
+                        $language_code = pll_current_language('slug');^M
                     }

                                        // User page translated slug

Viewing all articles
Browse latest Browse all 210725

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>