| 1 |
<?php |
| 2 |
namespace Kibo\PhastPlugins\PhastPress\Compat; |
| 3 |
|
| 4 |
class LiteSpeedCache { |
| 5 |
/** @return ?int */ |
| 6 |
public function getHookPriority() { |
| 7 |
try { |
| 8 |
$cls = new \ReflectionClass(\LiteSpeed\Core::class); |
| 9 |
$prop = $cls->getProperty('_instance'); |
| 10 |
$prop->setAccessible(true); |
| 11 |
$instance = $prop->getValue(); |
| 12 |
} catch (\ReflectionException $e) { |
| 13 |
return null; |
| 14 |
} |
| 15 |
|
| 16 |
if (!$instance) { |
| 17 |
return null; |
| 18 |
} |
| 19 |
|
| 20 |
$priority = has_filter('after_setup_theme', [$instance, 'init']); |
| 21 |
|
| 22 |
if ($priority === false) { |
| 23 |
return null; |
| 24 |
} |
| 25 |
|
| 26 |
return (int) $priority; |
| 27 |
} |
| 28 |
} |
| 29 |
|