| 1 |
<?php |
| 2 |
/** |
| 3 |
* Notice |
| 4 |
* Activate the bbPress |
| 5 |
* @return void |
| 6 |
*/ |
| 7 |
|
| 8 |
include_once BBPC_DIR . '/includes/admin/notices/core_installer.php'; |
| 9 |
new BBPCore_Install_Core(''); |
| 10 |
|
| 11 |
add_action( 'admin_notices', function(){ |
| 12 |
|
| 13 |
$has_installed = get_plugins(); |
| 14 |
$button_text = isset( $has_installed['bbpress/bbpress.php'] ) ? __( 'Activate Now!', 'bbp-core' ) : __( 'Install Now!', 'bbp-core' ); |
| 15 |
|
| 16 |
if( ! class_exists( 'bbPress' ) ) : |
| 17 |
?> |
| 18 |
<div class="error notice is-dismissible bottom-10"> |
| 19 |
<p> |
| 20 |
<?php echo sprintf( '<strong>%1$s</strong> %2$s <strong>%3$s</strong> %4$s', __( 'BBP Core', 'bbp-core' ), __( 'requires', 'bbp-core' ), __( 'bbPress', 'bbp-core' ), __( ' plugin to be installed. Please get the plugin now!', 'bbp-core' ) ) ?> |
| 21 |
</p> |
| 22 |
<p> |
| 23 |
<button id="bbp-core-install-core" class="button button-primary"> |
| 24 |
<?php echo esc_html($button_text); ?> |
| 25 |
</button> |
| 26 |
</p> |
| 27 |
</div> |
| 28 |
<?php |
| 29 |
endif; |
| 30 |
|
| 31 |
}); |