Wow, you are correct. They return the weather in m/s!
I just fixed that in version 1.5.3.
I also added a filter on the wind speed, wind speed text and direction if someone wants to do some calculations on that and convert it to whatever they want. The filter is called: awesome_weather_wind_speed
Thread Starter
allm
(@realblueorange)
I am glad to help.
Another wind speed measure is the beaufort scale. It is common in some parts of the world, but I am not quite sure if this is really something international. Using the new filter I guess people can do their own calculations.
To be complete: more info here:
https://en.wikipedia.org/wiki/Beaufort_scale
Great plugin. Keep up the good work. 🙂
I’m noticing that it seems the the wind speed changes when settings are changed from F to C but the wind speed units remain m/s.
I corrected that with:
add_filter( ‘awesome_weather_wind_speed’, ‘tweak’, 10, 1);
function tweak($sym) {
if($sym[‘units’] == ‘imperial’) {
$sym[‘text’] = ‘ mph ‘;
}
return $sym;
}
and when the apply_filters is called I added units to the array as:
$wind_speed_obj = apply_filters(‘awesome_weather_wind_speed’, array( ‘text’ => __(‘m/s’, ‘awesome-weather’),’speed’=> $today->wind->speed, ‘direction’ => $wind_direction, ‘units’ => $units), $today->wind->speed, $wind_direction );
Would this be correct? thanks I appreciate your work.
Ziggy