Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Error in browser

Discussion in 'Misc WordPress Requests' started by Howdy_McGee, Oct 23, 2017.

  1. Howdy_McGee

    Guest

    Reply To: Error in browser, by Howdy_McGee

    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.

    define( 'WP_DEBUG', false );

    Reply To: Error in browser
     
    #1

Share This Page

Web Hosting