| 1 |
<?php |
| 2 |
/** |
| 3 |
* Handles interactions with BuddyPress plugin. |
| 4 |
* |
| 5 |
* @package WP_Defender\Integrations |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WP_Defender\Integrations; |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
die; |
| 12 |
} |
| 13 |
|
| 14 |
/** |
| 15 |
* Buddypress integration module. |
| 16 |
* |
| 17 |
* @since 3.3.0 |
| 18 |
*/ |
| 19 |
class Buddypress { |
| 20 |
|
| 21 |
public const REGISTER_FORM = 'buddypress_register', NEW_GROUP_FORM = 'buddypress_new group'; |
| 22 |
|
| 23 |
/** |
| 24 |
* Check if Buddypress is activated. |
| 25 |
* |
| 26 |
* @return bool |
| 27 |
*/ |
| 28 |
public function is_activated(): bool { |
| 29 |
return class_exists( 'buddypress' ); |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Get the Defender forms. |
| 34 |
* |
| 35 |
* @return array |
| 36 |
*/ |
| 37 |
public static function get_forms(): array { |
| 38 |
return array( |
| 39 |
self::REGISTER_FORM => esc_html__( 'Registration', 'defender-security' ), |
| 40 |
self::NEW_GROUP_FORM => esc_html__( 'Add new group', 'defender-security' ), |
| 41 |
); |
| 42 |
} |
| 43 |
} |
| 44 |
|