File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,15 @@ Actions are hooks that do not modify data. You can add an action like this:
2525
2626``` php
2727use SaschaEnde\Hookable\Facades\Hookable;
28- Hookable::addAction ('my_action', function ($arg1, $arg2) {
28+ Hookable::action ('my_action', function ($arg1, $arg2) {
2929 // Do something with $arg1 and $arg2
3030});
3131```
3232
3333You can then trigger the action like this:
3434
3535``` php
36- Hookable::doAction ('my_action', $arg1, $arg2);
36+ Hookable::action ('my_action', $arg1, $arg2);
3737```
3838
3939#### Filters
@@ -42,7 +42,7 @@ Filters are hooks that modify data. You can add a filter like this:
4242
4343``` php
4444use SaschaEnde\Hookable\Facades\Hookable;
45- Hookable::addFilter ('my_filter', function ($value) {
45+ Hookable::filter ('my_filter', function ($value) {
4646 // Modify $value
4747 return $value;
4848});
@@ -59,7 +59,7 @@ $value = Hookable::applyFilters('my_filter', $value);
5959You can specify the priority and number of arguments for your hooks.
6060
6161``` php
62- Hookable::addAction ('my_action', function ($arg1, $arg2) {
62+ Hookable::filter ('my_action', function ($arg1, $arg2) {
6363 // Do something
6464}, 20);
6565```
You can’t perform that action at this time.
0 commit comments