WordPress.org

Ready to get started?Download WordPress

Forums

Ultimate CMS
[resolved] IE JS syntax error & Invalid argument supplied for foreach() (1 post)

  1. atti_simon
    Member
    Posted 2 years ago #

    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.php

    Loading 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!

    http://wordpress.org/extend/plugins/ultimate-cms/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic