Answers.Body: <p>The <a href="https://civicrm.org/extensions/civievent-widget" rel="nofollow noreferrer">document</a> says you add custom filters on shortcode</p>
  
  <p>try adding </p>
  
  <pre><code>[civievent_widget custom_filter='{"start_date":{"IS NOT NULL":1},"id":{"IN":&amp;#91;9,10,11&amp;#93;},"is_public":1,"options":{"sort": "start_date ASC"}}' admin_type="custom" custom_display='{"event_title_infolink":{"title":0,"prefix":null,"suffix":null,"wrapper":1},"description":{"title":1,"prefix":null,"suffix":null,"wrapper":1}}' limit=5] 
  </code></pre>
  
  <p>Also you will need to amend the patch below to decode html entities</p>
  
  <pre><code>diff --git a/civievent-widget.php b/civievent-widget.php
  index e973ce0..c3c2da4 100644
  --- a/civievent-widget.php
  +++ b/civievent-widget.php
  @@ -223,7 +223,7 @@ class civievent_Widget extends WP_Widget {
                                  $standardDisplay = true;
                          } else {
                                  // Get custom filters.
  -                               $customFilters = json_decode( CRM_Utils_Array::value( 'custom_filter', $instance, '' ), true );
  +                               $customFilters = json_decode(html_entity_decode(CRM_Utils_Array::value( 'custom_filter', $instance, '' )), true );
                                  $filterParams = array(
                                          'start_date' =&gt; array( '&gt;=' =&gt; date( 'Y-m-d' ) ),
                                          'is_public' =&gt; 1,
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T00:54:10.380Z
Answers.Text: Just tried: [civievent_widget admin_type="custom" '{"id": {"IN": [9,10,11]}}' limit=10], but sadly without success
Answers.UserDisplayName: user7275
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T01:03:16.920Z
Answers.Text: Sorry, that should have read, this is what i tried unsuccesfully: [civievent_widget admin_type="custom" custom_filter='{"id": {"IN": [9,10,11]}}' limit=10]
Answers.UserDisplayName: user7275
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T02:09:57.663Z
Answers.Text: you need to pass custom_filter, admin_type, custom_display
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T02:35:31.310Z
Answers.Text: Thanks for your help Ppradeep; I've tried your above suggestion. It's showing 5 events (sadly not limited to the right ID's) , and then the remaining part of the string below those 5 events: 
  
  },”is_public”:1,”options”:{“sort”: “start_date ASC”}}’ admin_type=”custom” custom_display='{“event_title_infolink”:{“title”:0,”prefix”:null,”suffix”:null,”wrapper”:1},”description”:{“title”:1,”prefix”:null,”suffix”:null,”wrapper”:1}}’ limit=5]
  
  Your help is really appreciated.
Answers.UserDisplayName: user7275
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T02:39:17.053Z
Answers.Text: I think wp short code doesn't support square bracket inside it unless there is a way
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T06:46:33.840Z
Answers.Text: Thanks for that pointer. I found that you can use `&#91;` and 93 to get around that. I've tried `[civievent_widget custom_filter='{"start_date":{"IS NOT NULL":1},"id":{"IN": &#91;9,10,11 &#93;},"is_public":1,"options":{"sort": "start_date ASC"}}' admin_type="custom" custom_display='{"event_title_infolink":{"title":0,"prefix":null,"suffix":null,"wrapper":1},"description":{"title":1,"prefix":null,"suffix":null,"wrapper":1}}' limit=5]` replacing the square bracket this way means it is not displaying the string anymore. 
  
  But it sadly still doesn't limit the displayed events to ID 9, 10 and 11.
Answers.UserDisplayName: user7275
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T10:48:52.847Z
Answers.Text: Updated my answer
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T21:55:44.107Z
Answers.Text: thank you so much for taking the time to try and help me get this resolved. Please forgive my ignorance, but could you explain what I should do with the code you supplied above? I'm very new to this.
  
  thanks again for the help
Answers.UserDisplayName: user7275
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T22:38:38.817Z
Answers.Text: add the patch in your civievent-widget plugin
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-02T20:21:35.317Z
Answers.Text: "add the patch in your civievent-widget plugin" how do I do this? 
  Having the same issue, none of the short code examples you gave work. only need to show one event type (6)
Answers.UserDisplayName: waikaeth
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-03T22:41:39.647Z
Answers.LastActivityDate: 2020-02-04T10:48:44.330Z
Answers.LastEditDate: 2020-02-04T10:48:44.330Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>we are using the CiviEvent Widget, I’m struggling to figure out how to display a list of event ids, but not others using shortcode.
  I would like for example to list events of id 9,10,11 exclusively.
  I've tried seperating the id's by coma, semi-colon etc... but have had no success, it usually just displays the first id number i list.</p>
  
  <p>Thanks for your help </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-03T22:01:59.443Z
Comments.Text: I am not sure that is possible - but someone from AGH may know.
Comments.UserDisplayName: themak
Tags: <civievent><widget>
Title: Listing only some event types with CiviEvent Widget
ThreadText: # Listing only some event types with CiviEvent Widget
  
  (Asked by: username_0 on 2020-02-03)
  
  we are using the CiviEvent Widget, I’m struggling to figure out how to display a list of event ids, but not others using shortcode.
  I would like for example to list events of id 9,10,11 exclusively.
  I've tried seperating the id's by coma, semi-colon etc... but have had no success, it usually just displays the first id number i list.
  
  Thanks for your help
  
  **Tags:** civievent, widget
  
  > **Comments:**
  > **username_1**: I am not sure that is possible - but someone from AGH may know.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-02-03. Score: 1
  
  The [document](https://civicrm.org/extensions/civievent-widget) says you add custom filters on shortcode
  
  try adding
  
  ```
  [civievent_widget custom_filter='{"start_date":{"IS NOT NULL":1},"id":{"IN":&#91;9,10,11&#93;},"is_public":1,"options":{"sort": "start_date ASC"}}' admin_type="custom" custom_display='{"event_title_infolink":{"title":0,"prefix":null,"suffix":null,"wrapper":1},"description":{"title":1,"prefix":null,"suffix":null,"wrapper":1}}' limit=5] 
  
  ```
  
  Also you will need to amend the patch below to decode html entities
  
  ```
  diff --git a/civievent-widget.php b/civievent-widget.php
  index e973ce0..c3c2da4 100644
  --- a/civievent-widget.php
  +++ b/civievent-widget.php
  @@ -223,7 +223,7 @@ class civievent_Widget extends WP_Widget {
                                  $standardDisplay = true;
                          } else {
                                  // Get custom filters.
  -                               $customFilters = json_decode( CRM_Utils_Array::value( 'custom_filter', $instance, '' ), true );
  +                               $customFilters = json_decode(html_entity_decode(CRM_Utils_Array::value( 'custom_filter', $instance, '' )), true );
                                  $filterParams = array(
                                          'start_date' => array( '>=' => date( 'Y-m-d' ) ),
                                          'is_public' => 1,
  
  ```
  
  > **Comments:**
  > **username_0**: Just tried: [civievent_widget admin_type="custom" '{"id": {"IN": [9,10,11]}}' limit=10], but sadly without success  
  > **username_0**: Sorry, that should have read, this is what i tried unsuccesfully: [civievent_widget admin_type="custom" custom_filter='{"id": {"IN": [9,10,11]}}' limit=10]  
  > **username_2**: you need to pass custom_filter, admin_type, custom_display  
  > **username_0**: Thanks for your help Ppradeep; I've tried your above suggestion. It's showing 5 events (sadly not limited to the right ID's) , and then the remaining part of the string below those 5 events:   },”is_public”:1,”options”:{“sort”: “start_date ASC”}}’ admin_type=”custom” custom_display='{“event_title_infolink”:{“title”:0,”prefix”:null,”suffix”:null,”wrapper”:1},”description”:{“title”:1,”prefix”:null,”suffix”:null,”wrapper”:1}}’ limit=5]  Your help is really appreciated.  
  > **username_2**: I think wp short code doesn't support square bracket inside it unless there is a way  
  > **username_0**: Thanks for that pointer. I found that you can use `&#91;` and 93 to get around that. I've tried `[civievent_widget custom_filter='{"start_date":{"IS NOT NULL":1},"id":{"IN": &#91;9,10,11 &#93;},"is_public":1,"options":{"sort": "start_date ASC"}}' admin_type="custom" custom_display='{"event_title_infolink":{"title":0,"prefix":null,"suffix":null,"wrapper":1},"description":{"title":1,"prefix":null,"suffix":null,"wrapper":1}}' limit=5]` replacing the square bracket this way means it is not displaying the string anymore.   But it sadly still doesn't limit the displayed events to ID 9, 10 and 11.  
  > **username_2**: Updated my answer  
  > **username_0**: thank you so much for taking the time to try and help me get this resolved. Please forgive my ignorance, but could you explain what I should do with the code you supplied above? I'm very new to this.  thanks again for the help  
  > **username_2**: add the patch in your civievent-widget plugin  
  > **username_3**: "add the patch in your civievent-widget plugin" how do I do this?  Having the same issue, none of the short code examples you gave work. only need to show one event type (6)  
  
  ---
  
  