mirror of
https://0xacab.org/radar/radar-wp.git
synced 2024-12-23 00:56:31 +01:00
Add filter by country(code).
This commit is contained in:
parent
cc1fc9a941
commit
4424f09f06
2 changed files with 5 additions and 2 deletions
|
@ -53,7 +53,6 @@ function radar_client() {
|
|||
|
||||
function radar_filter($settings) {
|
||||
$filter = new \Radar\Connect\Filter;
|
||||
|
||||
if (!empty($settings['city'])) {
|
||||
$filter->addCity($settings['city']);
|
||||
}
|
||||
|
@ -61,6 +60,9 @@ function radar_filter($settings) {
|
|||
$filter->addGroup($settings['group']);
|
||||
}
|
||||
|
||||
if (!empty($settings['country'])) {
|
||||
$filter->addCountry($settings['country']);
|
||||
}
|
||||
return $filter;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Description: Provides widget and short code to display radar events.
|
||||
* Plugin URI: http://radar.squat.net/
|
||||
* Author: Ekes
|
||||
* Version: 0.1.0-alpha1
|
||||
* Version: 0.1.0-alpha2
|
||||
* ================================================================== */
|
||||
|
||||
// TODO cron updating; and caching.
|
||||
|
@ -29,6 +29,7 @@ function radar_shortcode_events($attributes, $content = '') {
|
|||
'api_url' => 'https://new-radar.iskra.net/',
|
||||
'max_count' => 5,
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'group' => '',
|
||||
'fields' => array(
|
||||
'title',
|
||||
|
|
Loading…
Reference in a new issue