| 1 |
<?php |
| 2 |
declare( strict_types=1 ); |
| 3 |
|
| 4 |
namespace Imagify\ThirdParty\Hostings; |
| 5 |
|
| 6 |
use Imagify\EventManagement\SubscriberInterface; |
| 7 |
|
| 8 |
/** |
| 9 |
* Extendify compatibility class |
| 10 |
*/ |
| 11 |
class Extendify implements SubscriberInterface { |
| 12 |
/** |
| 13 |
* Returns an array of events that this subscriber wants to listen to. |
| 14 |
* |
| 15 |
* @return array |
| 16 |
*/ |
| 17 |
public static function get_subscribed_events(): array { |
| 18 |
return [ |
| 19 |
// @filter |
| 20 |
'imagify_hide_plugin_family' => 'hide_plugin_family', |
| 21 |
]; |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Hide the plugin family if the Extendify site ID option is present. |
| 26 |
* |
| 27 |
* @param bool $hide Current value. |
| 28 |
* |
| 29 |
* @return bool |
| 30 |
*/ |
| 31 |
public function hide_plugin_family( $hide ) { |
| 32 |
$option = get_option( 'extendify_site_id', false ); |
| 33 |
|
| 34 |
if ( false === $option ) { |
| 35 |
return $hide; |
| 36 |
} |
| 37 |
|
| 38 |
return true; |
| 39 |
} |
| 40 |
} |
| 41 |
|