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