Skip to content

Commit 17c32c0

Browse files
authored
Merge pull request #25 from workingconcept/develop
Clarify how filters are applied.
2 parents eb5c198 + aacfcb7 commit 17c32c0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ Some events can have filters applied to them, which prevent webhooks from being
9292

9393
<img src="./images/event-filters.png" width="414" height="381" alt="Screenshot of the Event Filters setting">
9494

95+
Ignored filters (``) will not have any impact. Positive filters (``) will be required for a webhook to execute, and a negative filter (`×`) will prevent it.
96+
9597
Only element class events and certain `craft\services\Elements` events have any filters out of the box, but modules and plugins can register additional filters using the `craft\webhooks\Plugin::EVENT_REGISTER_FILTER_TYPES` event.
9698

9799
```php

src/templates/_manage/edit.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@
8080
<th>{{ filter.displayName }}</th>
8181
<td>
8282
<div class="btngroup" tabindex="0">
83-
<div class="btn filter-no{% if filter.enabled and not filter.value %} active{% endif %}" data-icon="remove"></div>
84-
<div class="btn filter-ignore{% if not filter.enabled %} active{% endif %}"><div class="status"></div></div>
85-
<div class="btn filter-yes{% if filter.enabled and filter.value %} active{% endif %}" data-icon="checkmark"></div>
83+
<div class="btn filter-no{% if filter.enabled and not filter.value %} active{% endif %}" data-icon="remove" title="{{ 'Prevents webhook execution.'|t('webhooks') }}"></div>
84+
<div class="btn filter-ignore{% if not filter.enabled %} active{% endif %}" title="{{ 'No impact on webhook execution.'|t('webhooks') }}"><div class="status"></div></div>
85+
<div class="btn filter-yes{% if filter.enabled and filter.value %} active{% endif %}" data-icon="checkmark" title="{{ 'Required for webhook execution.'|t('webhooks') }}"></div>
8686
</div>
8787
<input type="hidden" name="filters[{{ filter.class }}]"{% if filter.enabled %} value="{{ filter.value ? 'yes' : 'no' }}"{% endif %}>
8888
</td>
@@ -95,6 +95,7 @@
9595
{{ forms.field({
9696
id: 'filters',
9797
label: 'Event Filters'|t('webhooks'),
98+
instructions: 'Checks that can determine whether a webhook should be executed.'|t('webhooks')
9899
}, filtersInput) }}
99100

100101
{% set urlInput %}

0 commit comments

Comments
 (0)