1
0
Fork 0
forked from lino/radar-wp

Fix empty array warning, correct syntax for cron timing storage.

This commit is contained in:
ekes 2021-11-12 15:50:26 +01:00
parent 835e9fa332
commit a34db48a4b

View file

@ -66,7 +66,7 @@ class Squat_Radar_Widget extends WP_Widget {
} }
} }
} }
set_option('squat_radar_widget_cron_run', $last_run); add_option('squat_radar_widget_cron_run', $last_run);
} }
/** /**
@ -76,8 +76,8 @@ class Squat_Radar_Widget extends WP_Widget {
$connector = new Squat_Radar_Connector(); $connector = new Squat_Radar_Connector();
$languages = apply_filters('wpml_active_languages', NULL); $languages = apply_filters('wpml_active_languages', NULL);
$languages = array_keys($languages); $languages = is_array($languages) ? array_keys($languages) : [];
$languages = array_merge($instance['url']['keys']['language'], (array) $languages); $languages = array_merge($instance['url']['keys']['language'], $languages);
foreach ($languages as $language) { foreach ($languages as $language) {
try { try {
// Force update. Don't set expire. // Force update. Don't set expire.