• I was getting the error message
    PHP Warning: foreach() argument must be of type array|object, null given in /home/trust/public_html/wp-content/plugins/geolocation/geolocation.php on line 333
    in the current version (1.9.7).

    The line number will differ slightly from your code but it’s the line following the comment
    // evaluate if the posts to be shown have geo data.

    I have resolved this problem on my copy by wrapping the foreach loop with
    if (isset($tmp_posts)) { … }

    Can this (or something like it) be included in a future version please?

The topic ‘PHP warning message in geolocate.php’ is closed to new replies.