Viewing 2 replies - 1 through 2 (of 2 total)
  • Talked with you on advanced wordpress group on facebook.

    The fix is:

    private function shortcode_localize($params) {
    		if (!empty($params) && is_array($params)) {
    			echo '
    					<script type="text/javascript">
    					/* <![CDATA[ */
    					var shortcode_localize = {';
    
    			foreach ($params as $key => $value) {
    				echo '"' . $key . '":"' . $value . '",';
    			}
    
    			echo ' };
    					/* ]]> */
    					</script>';
    		}
    	}

    Adding an IF statement that checks the $params verifying that it’s not empty and it’s an array.

    Plugin Author Mindshare Labs, Inc.

    (@mindshare)

    Thanks. We’ll look at this code in a future update. But right now development on this plugin has stalled out. We simply don’t have the time to work on it right now.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.