Conditions | 5 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function remove(string $hook, string $class, string $method): bool { |
||
21 | if (array_key_exists($hook, $GLOBALS['wp_filter']) === true) { |
||
22 | $filters = $GLOBALS['wp_filter'][$hook]; |
||
23 | } else { |
||
24 | return false; |
||
25 | } |
||
26 | $return = false; |
||
27 | foreach ($filters as $priority => $filter) { |
||
28 | foreach ($filter as $function) { |
||
29 | if (self::isFilterFunctionClass($function, $class, $method) === true) { |
||
30 | $return = remove_filter( |
||
31 | $hook, |
||
32 | [ |
||
33 | $function['function'][0], |
||
34 | $method, |
||
35 | ], |
||
36 | $priority |
||
37 | ); |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 | |||
42 | return $return; |
||
43 | } |
||
62 |