profilegrid.php
70 lines
| 1 | <?php |
| 2 | /** |
| 3 | * ProfileGrid core integrations file |
| 4 | * |
| 5 | * @since 1.0.0 |
| 6 | * @package SureTrigger |
| 7 | */ |
| 8 | |
| 9 | namespace SureTriggers\Integrations\ProfileGrid; |
| 10 | |
| 11 | use SureTriggers\Controllers\IntegrationsController; |
| 12 | use SureTriggers\Integrations\Integrations; |
| 13 | use SureTriggers\Traits\SingletonLoader; |
| 14 | |
| 15 | /** |
| 16 | * Class SureTrigger |
| 17 | * |
| 18 | * @package SureTriggers\Integrations\ProfileGrid |
| 19 | */ |
| 20 | class ProfileGrid extends Integrations { |
| 21 | |
| 22 | use SingletonLoader; |
| 23 | |
| 24 | /** |
| 25 | * ID |
| 26 | * |
| 27 | * @var string |
| 28 | */ |
| 29 | protected $id = 'ProfileGrid'; |
| 30 | |
| 31 | /** |
| 32 | * SureTrigger constructor. |
| 33 | */ |
| 34 | public function __construct() { |
| 35 | $this->name = __( 'ProfileGrid', 'suretriggers' ); |
| 36 | $this->description = __( 'Create WordPress user profiles, groups, communities, paid memberships, directories, WooCommerce profiles, bbPress profiles, content restriction, sign-up pages, blog submissions, notifications, social activity and private messaging, beautiful threaded interface and a lot more!', 'suretriggers' ); |
| 37 | $this->icon_url = SURE_TRIGGERS_URL . 'assets/icons/profilegrid.svg'; |
| 38 | |
| 39 | parent::__construct(); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Profile Grid Group Details. |
| 44 | * |
| 45 | * @param int|string $group_id Group ID. |
| 46 | * |
| 47 | * @return array |
| 48 | */ |
| 49 | public static function pg_group_details( $group_id ) { |
| 50 | global $wpdb; |
| 51 | $group = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}promag_groups WHERE id = %d", $group_id ), ARRAY_A ); |
| 52 | |
| 53 | return [ |
| 54 | 'group_name' => $group['group_name'], |
| 55 | 'group_description' => $group['group_desc'], |
| 56 | ]; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Is Plugin dependent plugin is installed or not. |
| 61 | * |
| 62 | * @return bool |
| 63 | */ |
| 64 | public function is_plugin_installed() { |
| 65 | return class_exists( 'Profile_Magic' ); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | IntegrationsController::register( ProfileGrid::class ); |
| 70 |