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: src/features/README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Features
2
2
3
-
Features should be PHP classes that implement the [Alley\WP\Types\Feature interface](https://github.com/alleyinteractive/wp-type-extensions/blob/main/src/alley/wp/types/interface-feature.php).
3
+
Features should be PHP classes that implement the [Alley\WP\Types\Feature interface](https://github.com/alleyinteractive/wp-type-extensions/blob/main/src/types/interface-feature.php).
4
4
5
5
Features should be located in the `src/features` directory of the plugin and have namespace `Create_WordPress_Plugin\Features;`
6
6
7
7
The following variable is passed to the `Class_Hello` feature in each of the following examples. This shows how we can remove any business logic from the feature and pass it in when the feature is added.
8
8
9
-
```
9
+
```php
10
10
$lyrics = "Hello, Dolly
11
11
Well, hello, Dolly
12
12
It's so nice to have you back where you belong
@@ -25,7 +25,7 @@ $lyrics = "Hello, Dolly
25
25
26
26
Files in the features directory will be autoloaded, but features will not be automatically instantiated. Features are typically instantiated in the plugin's `main()` function.
27
27
28
-
```
28
+
```php
29
29
function main(): void {
30
30
// Add features here.
31
31
$plugin = new Group(
@@ -43,7 +43,7 @@ function main(): void {
43
43
44
44
This is a port of the infamous WordPress `hello.php` plugin to a feature. The lyrics would be passed in when the feature was called, as shown above.
0 commit comments