0

After update to PHP version above 7.1, I've got an error:

Warning: Use of undefined constant slug - assumed 'slug' (this will throw an Error in a future version of PHP)

The indication applies to the code that I use to support languages on the page (Polyang plugin).

Part of code:

global $current_lang;
$current_lang = pll_current_language(slug);

How to fix it?

Pat
  • 697
  • 3
  • 11
  • 30
  • If there is a solution to update packages/libraries - then I can re-open the question. – Nigel Ren Jul 17 '19 at 12:10
  • It's OP's code -and not a library/package- that's at fault, it seems. If so, they should be able to fix it themselves by following the instructions from the suggested link. – cabrerahector Jul 17 '19 at 12:21
  • The solution is to add ' ', so in this example it will be `('slug')` – Pat Jul 18 '19 at 13:03

0 Answers0