You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apis/plugintypes/mod/_files/lib_description.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,22 +61,22 @@ function [modname]_supports($feature) {
61
61
62
62
:::tip
63
63
64
-
To have your Activity plugin classified in the right Activity category, you must define the function `[modname]_supports` and add the `FEATURE_MOD_PURPOSE` constant:
64
+
To have your Activity plugin classified in the right Activity category, you must define the function `[modname]_supports` and add the `FEATURE_MOD_PURPOSE` constant.
65
+
66
+
Optionally, if your plugin fits in a secondary purpose, you should add the `FEATURE_MOD_OTHERPURPOSE` constant as well.
65
67
66
68
<details>
67
69
<summary>View example</summary>
68
70
<div>
69
71
70
72
```php
71
73
function [modname]_supports(string $feature) {
72
-
switch ($feature) {
73
-
[...]
74
-
case FEATURE_MOD_PURPOSE:
75
-
return MOD_PURPOSE_XXXXXX;
76
-
77
-
default:
78
-
return null;
79
-
}
74
+
return match ($feature) {
75
+
// The rest of features should be listed here...
76
+
FEATURE_MOD_PURPOSE => MOD_PURPOSE_COLLABORATION,
77
+
FEATURE_MOD_OTHERPURPOSE => MOD_PURPOSE_COMMUNICATION, // Could be omitted if not needed.
0 commit comments