File tree Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Original file line number Diff line number Diff line change 8
8
9
9
/**
10
10
* Action attribute class
11
+ *
12
+ * Extends Filter, because add_action and add_filter is actually the same:
13
+ * https://developer.wordpress.org/reference/functions/add_action/#source
11
14
*/
12
15
#[Attribute(Attribute::TARGET_METHOD |Attribute::IS_REPEATABLE )]
13
- class Action implements HookInterface
16
+ class Action extends Filter
14
17
{
15
- /**
16
- * Construct the action class
17
- *
18
- * @param string $hook
19
- * @param integer $priority
20
- * @param integer $acceptedArgs
21
- */
22
- public function __construct (
23
- public string $ hook ,
24
- public int $ priority = 10 ,
25
- public int $ acceptedArgs = 1
26
- )
27
- {
28
- }
29
-
30
- /**
31
- * Register the action
32
- *
33
- * @param callable|array $method
34
- * @return void
35
- */
36
- public function register (callable |array $ method ): void
37
- {
38
- add_action ($ this ->hook , $ method , $ this ->priority , $ this ->acceptedArgs );
39
- }
40
18
}
You can’t perform that action at this time.
0 commit comments