FIX for PHP errors and wrong location
-
Developer seems absent from this forum, but this is for them or anyone using this plugin – the fix for errors is super easy, and is just correcting a syntax error/typo.
If you want to avoid that and use the stormia shortcode, you’ll need to update a few lines of code in the stormia.php file. The dev incorrectly used the variable $attrs instead of the correct $atts six times, starting around line 30. Here is the incorrect code:
if(array_key_exists('lat', $attrs) && array_key_exists('lon', $attrs)) { $latlong = '&lat='.$attrs['lat'].'&lon='.$attrs['lon']; } else { $latlong = ''; } $html .= '<iframe src="https://stormia.io/embed?l='.$attrs["layer"].'&z='.$attrs["zoom"].$latlong.'" style="width:100%;border:0;margin-bottom:0;" height="'.$atts["height"].'" frameborder="'.$atts["frameborder"].'"></iframe><div style="width:100%;text-align:right;">';
If you replace those $attrs with $atts everything will work fine.
As an aside, this plugin is essentially just a shortcode for an iframe embed; you can easily do this without a plugin with just a little effort.
Hope that helps someone!
- The topic ‘FIX for PHP errors and wrong location’ is closed to new replies.