Add filter by country(code).

This commit is contained in:
ekes 2015-04-14 11:55:14 +02:00
parent cc1fc9a941
commit 4424f09f06
2 changed files with 5 additions and 2 deletions

View file

@ -53,7 +53,6 @@ function radar_client() {
function radar_filter($settings) { function radar_filter($settings) {
$filter = new \Radar\Connect\Filter; $filter = new \Radar\Connect\Filter;
if (!empty($settings['city'])) { if (!empty($settings['city'])) {
$filter->addCity($settings['city']); $filter->addCity($settings['city']);
} }
@ -61,6 +60,9 @@ function radar_filter($settings) {
$filter->addGroup($settings['group']); $filter->addGroup($settings['group']);
} }
if (!empty($settings['country'])) {
$filter->addCountry($settings['country']);
}
return $filter; return $filter;
} }

View file

@ -5,7 +5,7 @@
* Description: Provides widget and short code to display radar events. * Description: Provides widget and short code to display radar events.
* Plugin URI: http://radar.squat.net/ * Plugin URI: http://radar.squat.net/
* Author: Ekes * Author: Ekes
* Version: 0.1.0-alpha1 * Version: 0.1.0-alpha2
* ================================================================== */ * ================================================================== */
// TODO cron updating; and caching. // TODO cron updating; and caching.
@ -29,6 +29,7 @@ function radar_shortcode_events($attributes, $content = '') {
'api_url' => 'https://new-radar.iskra.net/', 'api_url' => 'https://new-radar.iskra.net/',
'max_count' => 5, 'max_count' => 5,
'city' => '', 'city' => '',
'country' => '',
'group' => '', 'group' => '',
'fields' => array( 'fields' => array(
'title', 'title',