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: README.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,25 @@ class My_Plugin {
24
24
}
25
25
```
26
26
27
-
# Required Folder Structure
27
+
### Defining a custom block prefix
28
+
The trait will default to using the 'bm' prefix for blocks. Blocks are named with a prefix to scope them to the project they are a part of. This also influences how the script and style handles are registered ($prefix-block-$block_name).
29
+
30
+
Your project probably requires its custom prefix. You can set it on the main plugin class like so:
31
+
32
+
```
33
+
use BernskioldMedia\WP\Block_Plugin_Support\Traits\Has_Blocks;
@@ -34,14 +52,15 @@ The trait assumes the following folder structure:
34
52
35
53
`languages/` is the location of the translation files. The handle and domain are both set to `{$block_prefix}-{$block_name}`.
36
54
37
-
# Required Methods
55
+
##Required Methods
38
56
39
57
The trait relies on two methods to be implemented.
40
58
41
59
-`get_url()` should return the URL to the plugin directory.
42
60
-`get_path()` should return the path to the plugin directory.
61
+
-`get_textdomain()` should return the string plugin textdomain.
43
62
44
-
# Hooks & Filters
63
+
##Hooks & Filters
45
64
46
65
We strive to make all code easily customizable with plenty of filters and hooks as needed. You never know when or why you might need that simple one-off customization.
0 commit comments