| 1 |
<?php |
| 2 |
class Admin { |
| 3 |
/** |
| 4 |
* Admin class construct |
| 5 |
*/ |
| 6 |
public function __construct() { |
| 7 |
if ( ! class_exists( 'bbPress' ) ) { |
| 8 |
add_action( 'admin_notices', [ $this, 'admin_notices' ] ); |
| 9 |
} |
| 10 |
|
| 11 |
new admin\Menu(); |
| 12 |
$this->load_csf(); |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Load Codestar Framework and related settings. |
| 17 |
* |
| 18 |
* @return void |
| 19 |
*/ |
| 20 |
public function load_csf() { |
| 21 |
require BBPC_DIR . 'includes/admin/settings/codestar-framework/codestar-framework.php'; |
| 22 |
if ( ! class_exists( 'BBPCorePro' ) ) { |
| 23 |
require BBPC_DIR . 'includes/admin/settings/options/settings.php'; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
/** |
| 28 |
* Show admin notices when needed. |
| 29 |
*/ |
| 30 |
public function admin_notices() { |
| 31 |
$message = sprintf( |
| 32 |
/* translators: 1: BBP Core 2: bbPress */ |
| 33 |
esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'bbp-core' ), |
| 34 |
'<strong>' . esc_html__( 'BBP Core Plugin', 'bbp-core' ) . '</strong>', |
| 35 |
'<strong>' . esc_html__( 'bbPress', 'bbp-core' ) . '</strong>' |
| 36 |
); |
| 37 |
|
| 38 |
printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message ); |
| 39 |
} |
| 40 |
} |
| 41 |
|