-1

I am looking at my 'WP_DEBUG' errors and the following two errors/notices pop up in a number of PHP files:

Notice: Undefined variable: defaultUI in...
Notice: Undefined variable: compileShortcodeUI in...

I have checked all of the the PHP files and lines specifically and every single one of these refers to this same bit of code:

$compileShortcodeUI .= "<div class='whatInsert whatInsert_".$shortcodeName."'>".$defaultUI."</div>";

What do I need to change to remove these errors?

Sam
  • 49
  • 2
  • 12
  • Well either you need to remove that line of code, or make sure the variables used are actually set to some value before it … – 04FS Apr 02 '19 at 09:07

1 Answers1

2

You have to define the variable initially.

$compileShortcodeUI = ''; // null or any default value
$defaultUI = ''; // null or any default value
$compileShortcodeUI .= "<div class='whatInsert whatInsert_".$shortcodeName."'>".$defaultUI."</div>";
Punitha Subramani
  • 1,467
  • 1
  • 8
  • 6