[Plugin: Ultimate CMS] IE JS syntax error & Invalid argument supplied for foreach()
-
Hello,
I got a JS syntax error in IE8:
Line: 115 Character: 2 Code: 0 Error Message: Syntax error URL: http://localhost/blog/wp-content/plugins/ultimate-cms/script.phpLoading the above link, I got a PHP error output in the code:
Invalid argument supplied for foreach() in <b>C:\xampp\htdocs\blog\wp-content\plugins\ultimate-cms\page-type\class-xydac-page-type-functions.php</b> on line <b>27</b><br />In class-xydac-page-type-functions.php, at line 27 I have:
foreach ($cpts as $cpt) { if(isset($cpt["content_js"])) $st.="\n/*============START PAGE TYPE ".$cpt['name']."=============================*/\n".$cpt["content_js"]."\n/*============END ".$cpt['name']."=============================*/\n"; }Following the solution from this post, I added (array) to the foreach, like this:
foreach ((array)$cpts as $cpt) { if(isset($cpt["content_js"])) $st.="\n/*============START PAGE TYPE ".$cpt['name']."=============================*/\n".$cpt["content_js"]."\n/*============END ".$cpt['name']."=============================*/\n"; }…and the PHP error was gone!
Cheers!
The topic ‘[Plugin: Ultimate CMS] IE JS syntax error & Invalid argument supplied for foreach()’ is closed to new replies.