php error invalid argument for foreach()
-
doing some debug work, and came across this error:
Invalid argument supplied for foreach() in /nas/content/staging/outputinc/wp-content/plugins/post-snippets/src/PostSnippets/WPEditor.php on line 189
changing the line from:
foreach ($snippets as $key => $snippet)
to
foreach ((array) $snippets as $key => $snippet)
removed the warning and seems to have not broken any functionality, but I wanted to run this by some peers on here to see if there is anything I’m missing with this edit that may become hazardous.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘php error invalid argument for foreach()’ is closed to new replies.