Title: Error in browser
Last modified: October 23, 2017

---

# Error in browser

 *  [marinamarketing](https://wordpress.org/support/users/marinamarketing/)
 * (@marinamarketing)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/error-in-browser/)
 * I’m getting the following message at the top of the browser:
 * “Warning: Invalid argument supplied for foreach() in /home/site/site.com/wp-content/
   plugins/aphrodite-support/templates/aphrodite_inst.php on line 109”
 * Here is what is on that line 109:
    foreach ($media_request_array as $key => $
   value) {
 * Thank you
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-in-browser%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/error-in-browser/#post-9612884)
 * I’m not sure what that plugin is so I’ll assume it’s a custom plugin. Otherwise,
   if it’s a plugin you plan on updating sometime in the future ( which if it’s 
   not a custom one, you want to keep all the things up to date ) you should not
   mess or change this plugin file.
 * This kind of error usually means that the variable passed into the foreach is
   not an array. Odds are at some point it’s empty. An easy fix for this is to break
   out of that functionality if the variable is empty or provide some kind of default
   data to the variable:
 *     ```
       if( ! empty( $media_request_array ) && is_array( $media_request_array ) ) {
   
       	foreach( $media_request_array as $key => $value ) {
   
       		/** ... **/
   
       	}
   
       }
       ```
   
 * – – – – –
 * Additionally, you can ignore this error assuming it’s not breaking your website
   by turning off debugging in the root installation [`wp-config.php` file](https://codex.wordpress.org/Debugging_in_WordPress).
 * `define( 'WP_DEBUG', false );`

Viewing 1 replies (of 1 total)

The topic ‘Error in browser’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/error-in-browser/#post-9612884)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
