While using profile pic plugin, I encountered with an error therefore thought to share it with reader.
1 2 3 |
Warning: Invalid argument supplied for foreach() in /home/mylitera/public_html/wp-content/plugins/profile-pic/profile-pic.php on line 422 |
1 2 3 4 |
Warning: Cannot modify header information - headers already sent by (output started at /home/mylitera/public_html/wp-content/plugins/profile-pic/profile-pic.php:422) in /home/mylitera/public_html/wp-includes/pluggable.php on line 890 |
This only happens when when none of the profile check boxes are checked at the time of updating a profile.
To fix the problem, in profile-pic.php, I changed lines 422 through 424 from this:
1 2 3 |
foreach ($raw_data as $key => $val) { $reversed_data[$val] = $key; } |
To this:
1 2 3 4 5 6 |
if(is_array($raw_data)) { foreach ($raw_data as $key => $val) { $reversed_data[$val] = $key; } } |
That seemed to work for me!
Comment Policy:
Your words are your own, so be nice and helpful if you can. Please, only use your real name, not your business name or keywords. Using business name or keywords instead of your real name will lead to the comment being deleted. Anonymous commenting is not allowed either. Limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.