| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
if ( ! class_exists( 'MywpIncompatible' ) ) : |
| 8 |
|
| 9 |
final class MywpIncompatible { |
| 10 |
|
| 11 |
public static function init() { |
| 12 |
|
| 13 |
add_action( 'admin_notices' , array( __CLASS__ , 'admin_notices' ) ); |
| 14 |
|
| 15 |
add_action( 'network_admin_notices' , array( __CLASS__ , 'admin_notices' ) ); |
| 16 |
|
| 17 |
} |
| 18 |
|
| 19 |
public static function admin_notices() { |
| 20 |
|
| 21 |
if( is_multisite() ) { |
| 22 |
|
| 23 |
if( ! MywpApi::is_network_manager() ) { |
| 24 |
|
| 25 |
return false; |
| 26 |
|
| 27 |
} |
| 28 |
|
| 29 |
} else { |
| 30 |
|
| 31 |
if( ! MywpApi::is_manager() ) { |
| 32 |
|
| 33 |
return false; |
| 34 |
|
| 35 |
} |
| 36 |
|
| 37 |
} |
| 38 |
|
| 39 |
?> |
| 40 |
|
| 41 |
<div class="error"> |
| 42 |
<p> |
| 43 |
<?php printf( __( 'Sorry, My WP is <strong>Incompatible</strong> with your version of WordPress. Require version %s.' , 'my-wp' ) , esc_html( MYWP_REQUIRED_WP_VERSION ) ); ?> |
| 44 |
</p> |
| 45 |
</div> |
| 46 |
|
| 47 |
<?php |
| 48 |
|
| 49 |
} |
| 50 |
|
| 51 |
} |
| 52 |
|
| 53 |
endif; |
| 54 |
|