myWeather widget
To create a quick and dirty widget from myWeather wordpress plugin just add the following to the end of myweather.php
-
-
function widget_weather_init() {
-
-
return;
-
}
-
-
function widget_weather($args)
-
{
-
wp_myweather();
-
echo $after_widget;
-
}
-
-
add_action(‘widgets_init’, ‘widget_weather_init’);
-
Also the part where you search for the city could be added as a control for the widget but i didn’t relay need it to be .
MyWeather plugin’s homepage.
Update
If you have multiple users with different credentials on your blog and you are the only administrator you can restrict the access to myWeather plugin administration interface by changing the function myweather_to_admin() to look like this (use 10 instead of 1 for required level) :
-
-
function myweather_to_admin() {
-
add_submenu_page(‘options-general.php’, ‘myWeather’,
-
}
-
}
-
Tags:myweather, plugin, wordpress
Related:Topics: Programming




Stupendo, non ci avevo proprio pensato.
Se sei daccordo lo inserisco nella prossima versione, naturalmente citandoti fra gli autori (fammi sapere se hai un account su wordpress.com cosi verrai direttamente linkato il tuo profilo)
Certo che sono daccordo a inserire le funzioni nella prossima vertione.
Il mio username su wordpress.com e alpinism, pero se vuoi puoi linkare a questo blog - http://www.erata.net
The plugin has been updated by the author to include widget support, but the wigetized version only works with php5. So if you are stuck with php4 manual editing is the way to go.
The latest version of the plugin has widget support and it’s working with php4.
Ho già aggiornato i file. Al prossimo update conterrà anche questa modifica.
Come al solito grazie.