mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
add option to show events of a specific group by indicating its name
This commit is contained in:
@@ -27,6 +27,7 @@ class EventsListWidget extends \WP_Widget {
|
||||
|
||||
$classNamePrefix = NAME;
|
||||
$eventsCount = $options['eventsCount'];
|
||||
$groupName = isset($options['groupName']) ? $options['groupName'] : '';
|
||||
$url = Settings::getUrl();
|
||||
$textDomain = TEXT_DOMAIN;
|
||||
|
||||
@@ -38,6 +39,7 @@ class EventsListWidget extends \WP_Widget {
|
||||
public function form($options) {
|
||||
$title = !empty($options['title']) ? $options['title'] : esc_html__('Events', TEXT_DOMAIN);
|
||||
$eventsCount = !empty($options['eventsCount']) ? $options['eventsCount'] : DEFAULT_EVENTS_COUNT;
|
||||
$groupName = !empty($options['groupName']) ? $options['groupName'] : '';
|
||||
$textDomain = TEXT_DOMAIN;
|
||||
|
||||
require dirname(__DIR__) . '/view/events-list-widget/form.php';
|
||||
@@ -50,6 +52,7 @@ class EventsListWidget extends \WP_Widget {
|
||||
$options = array();
|
||||
$options['title'] = !empty($new_options['title']) ? sanitize_text_field($new_options['title']) : '';
|
||||
$options['eventsCount'] = !empty($new_options['eventsCount']) ? sanitize_text_field($new_options['eventsCount']) : 5;
|
||||
$options['groupName'] = !empty($new_options['groupName']) ? sanitize_text_field($new_options['groupName']) : '';
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user