Skip to content
Snippets Groups Projects
Commit 4424f09f authored by ekes's avatar ekes
Browse files

Add filter by country(code).

parent cc1fc9a9
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,6 @@ function radar_client() { ...@@ -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) { ...@@ -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;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -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 = '') { ...@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment