shelbybark
Forum Replies Created
-
Forum: Plugins
In reply to: [m1.MiniWeather] Widget not using FahrenheitI have made some adjustments to fix this issue. Let me know if you can incorporate the changes:
`
diff –git a/index.php b/index.php
index 81ef7a7..c1ee5c9 100755
— a/index.php
+++ b/index.php
@@ -16,7 +16,7 @@ Author URI: https://maennchen1.de
load_plugin_textdomain(‘m1mw’, false, basename( dirname( __FILE__ ) ) . ‘/languages’ );class Wx {
– public function getWeather($lat = false, $long = false, $api_key = false) {
+ public function getWeather($lat = false, $long = false, $api_key = false, $temp_fmt = ‘C’) {
$data = new stdClass();
if($lat && $long && $api_key) {
try {
@@ -35,6 +35,11 @@ class Wx {
$main = $data->main;
$data->tempC = round(($main->temp -273.15), 0);
$data->tempF = round(((($data->tempC * 9 ) / 5) + 32) ,0);
+ if($temp_fmt === ‘F’) {
+ $data->tempP = $data->tempF;
+ } else {
+ $data->tempP = $data->tempC;
+ }
}} catch(Exception $ex) {
@@ -75,7 +80,7 @@ class m1_miniweather_widget extends WP_Widget
{
//renew!
$m1mw = new Wx();
– $m1mw_data = $m1mw->getWeather($settings[‘m1mw_lat’], $settings[‘m1mw_long’], $settings[‘m1mw_api_key’]);
+ $m1mw_data = $m1mw->getWeather($settings[‘m1mw_lat’], $settings[‘m1mw_long’], $settings[‘m1mw_api_key’], $settings[‘m1mw_value’]);
if (!$m1mw_data->error)
{
update_option( ‘m1_miniweather_renew_last’, time() );
@@ -99,7 +104,7 @@ class m1_miniweather_widget extends WP_Widget
echo $args[‘after_title’];
if ($m1mw_data->error ===false) {
echo ‘<div class=”wi wi-owm-‘ . $m1mw_data->weather[0]->id .'” title=”‘ . $m1mw_data->weather[0]->description . ‘” style=”font-size: 2em;’ . $m1mw_fontColor . ‘”>
– <span class=”m1mw_temp”>’ . $m1mw_data->tempC . ‘°</span>
+ <span class=”m1mw_temp”>’ . $m1mw_data->tempP . ‘°</span>
</div>’;
} else {
echo $m1mw_data->error;Forum: Plugins
In reply to: [Featured Galleries] Attachment Details missing using WordPress 4.6.1Thanks! Sorry I missed that.
Forum: Plugins
In reply to: [RSS Feed Widget] Setting the Feed Cache from the pluginYes, excellent! The only thing I noticed is that the value doesn’t “stick” after saving. It clears out of the field. Is that the intended functionality? Or should it show in the field after saving the widget?
Thanks for the help!
Forum: Plugins
In reply to: [RSS Feed Widget] Setting the Feed Cache from the pluginYes, either a setting within each Widget or a general plugin setting.