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);
}
/**
@ -75,9 +75,9 @@ class Squat_Radar_Widget extends WP_Widget {
protected static function cache_refresh($instance) {
$connector = new Squat_Radar_Connector();
$languages = apply_filters( 'wpml_active_languages', NULL);
$languages = array_keys($languages);
$languages = array_merge($instance['url']['keys']['language'], (array) $languages);
$languages = apply_filters('wpml_active_languages', NULL);
$languages = is_array($languages) ? array_keys($languages) : [];
$languages = array_merge($instance['url']['keys']['language'], $languages);
foreach ($languages as $language) {
try {
// Force update. Don't set expire.