Question

I'm having a serious issue with Wordpress 3.1 with Multi Site enabled and my themes custom shortcode generator. For some reason, I'm getting the following error whenever I create a new page/post/custom post type page, etc. It is specifically an issue with radio buttons and the 'name' tag. When its removed, everything works fine. When it is set to a variable, I get the error. However, setting the variable to a constant (such as text) causes it to work again.

This is the error I am getting; I have no clue what it means and what is causing it:

Warning: Invalid argument supplied for foreach() in /home/matthew/public_html/wp-admin/includes/post.php on line 197

Warning: Cannot modify header information - headers already sent by (output started at /home/matthew/public_html/wp-admin/includes/post.php:197) in /home/matthew/public_html/wp-includes/pluggable.php on line 897

Here is the PHP code (check line 892): http://pastebin.com/BNK7wE2W

I'm a bit skeptical about releasing too much information before the theme is released, but if access to the admin panel is required then if possible get in touch with me.

Thanks in advance, Matthew.

Was it helpful?

Solution

I did spot one problem in your case clause for radio buttons: In your <label> tag, you use $val, but I think you meant $option['id'].

I don't see how it could be related to the foreach error you're getting, but it won't hurt to fix it.

The odd thing is that the real error is coming from core code: wp-admin/includes/post.php, line 197. It looks like you're passing in some post meta, but you aren't passing in an array, like it wants. Does that help you narrow things down?

OTHER TIPS

When you get:

Warning: Cannot modify header information - headers already sent by (output started at...

Reason and Solution : It is usually because there are spaces, newlines, or other garbage before an opening <?php tag or after a closing ?> tag. make sure there are none and save as utf-8 without bom

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top