Hey all,
Am working with anothers script on a Wordpress plugin.
There is a menu added to one page in the admin area of the plugin using this:
<div class="menu-cat">
<h2>select category</h2>
<div class='submenu' >
<a href="<?= $curaddress ?>" >home</a>
</div>
<?
foreach($cat as $n=>$c):
echo "
<h3>{$c['info']->name}</h3>
";
foreach ( $c['list'] as $k => $r ):
$sub = omegaid($r->id);
echo "
<div class='submenu' >
<a href='{$curaddress}&task=listing&sub={$sub}' >{$r->name}</a>
</div>
";
endforeach;
endforeach;
?>
<div class='clr clear ' ></div>
</div>
These two are being called in the beginning of the page:
$curaddress = get_curaddress();
$curaddress = get_urlpath('task');
This works great on it's current page displaying the menu brilliantly but when I tried to add it to another page for the plugin admin I get a "Warning: Invalid argument supplied for foreach()" on both foreach arguments. *I take out the first one to see if the second would fire and still get the error.
Now, after messing around with this for a bit I just copied EVERYTHING from the working page and pasted over EVERYTHING in the page I want the menu to work on. I still get errors.
I would think that it should work here since it works perfect on the other page. What in the heck am I missing here? Is there a rule where I can only use a specific foreach argument once?
Any help at all would be greatly appreciated..