Test Failed
Push — master ( 50dd93...f69d16 )
by Chris
12:03
created

TargetsEditFormTopHook::targetEditFormTopHook()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Leonidas\Hooks;
4
5
use Closure;
6
use WP_Post;
7
8
trait TargetsEditFormTopHook
9
{
10
    protected function targetEditFormTopHook()
11
    {
12
        add_action(
13
            "edit_form_top",
14
            Closure::fromCallable([$this, 'doEditFormTopAction']),
15
            $this->getEditFormTopPriority(),
16
            PHP_INT_MAX
17
        );
18
19
        return $this;
20
    }
21
22
    protected function getEditFormTopPriority(): int
23
    {
24
        return 10;
25
    }
26
27
    abstract protected function doEditFormTopAction(WP_Post $post): void;
28
}
29