0

After updating to Wordpress 4.8 widgets stop working, I mean the textarea inside has disappeared and I read the following error in console:

ReferenceError: Can't find variable: wp
Global Code — widgets.php:202

Looking into the file I see the line causing the issue:

wp.mediaWidgets.init();

and so on. There are other blocks related to the wp variable but I really cannot understand why it's happening considering that I've already tried to disable all plugins without success. Any advice?

Thanks.

andreas
  • 16,357
  • 12
  • 72
  • 76
middlelady
  • 573
  • 2
  • 13
  • 36
  • Can you try switching to one of the default WordPress themes (ex: TwentySeventeen)? If that works, then you know the problem is something with your theme. – rideron89 Jun 20 '17 at 18:40
  • Thanks for your answer @rideron89, I'll try again but I already done it. Going mad... :D – middlelady Jun 21 '17 at 06:46

2 Answers2

0

How did you update to 4.8? You might try manually updating WordPress. Your issue could be from inconsistent versions of some files. Source

Check out these instructions.

If this doesn't work, can you say which widgets.php file is causing the problem? I noticed there were a few files with that name in the codebase.

rideron89
  • 491
  • 3
  • 14
0

I actually solved manually restoring the Wordpress core and cleaning the wp-config.php. Furthermore there was a function in my theme deferring javascript and that was the main cause, most likely.

middlelady
  • 573
  • 2
  • 13
  • 36