Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks so much, the old pages must still have been cached (I’m using WP Super Cache), because today the message has disappeared!
    All seems to work now ??

    I have made the update to this file class-wordpress-google-maps.php in the path given by the warning msg. See https://www.nrfhideout.com. Message text is “Warning: Invalid argument supplied for foreach() in /home1/ambruck/public_html/wp-content/plugins/google-maps-builder/public/class-wordpress-google-maps.php on line 537”. Doesn’t fix the problem. Function is copied in here:

    public function check_for_multiple_google_maps_api_calls() {

    global $wp_scripts;

    $multiple_google_maps_api = false;

    if(is_null($wp_scripts) || is_null($wp_scripts->registered)){

    return $multiple_google_maps_api;

    }

    //loop through registered scripts
    foreach ( $wp_scripts->registered as $registered_script ) {

    //find any that have the google script as the source, ensure it’s not enqueud by this plugin
    if ( strpos( $registered_script->src, ‘maps.googleapis.com/maps/api/js’ ) !== false && strpos( $registered_script->handle, ‘google-maps-builder’ ) === false ) {

    $multiple_google_maps_api = true;
    //ensure we can detect scripts on the frontend from backend; we’ll use an option to do this
    if ( ! is_admin() ) {
    update_option( ‘gmb_google_maps_conflict’, true );
    }

    }

    }

    //Ensure that if user resolved conflict on frontend we remove the option flag
    if ( $multiple_google_maps_api === false && ! is_admin() ) {
    update_option( ‘gmb_google_maps_conflict’, false );
    }

    //returns boolean
    return $multiple_google_maps_api;
    }

Viewing 2 replies - 1 through 2 (of 2 total)