Example #1
0
function BUDDYBOSS_BMT_init()
{
    if (!function_exists('bp_is_active')) {
        return;
    }
    global $BUDDYBOSS_BMT;
    $main_include = BUDDYBOSS_BMT_PLUGIN_DIR . 'includes/main-class.php';
    try {
        if (file_exists($main_include)) {
            require $main_include;
        } else {
            $msg = sprintf(__("Couldn't load main class at:<br/>%s", 'bp-member-types'), $main_include);
            throw new Exception($msg, 404);
        }
    } catch (Exception $e) {
        $msg = sprintf(__("<h1>Fatal error:</h1><hr/><pre>%s</pre>", 'bp-member-types'), $e->getMessage());
        echo $msg;
    }
    $BUDDYBOSS_BMT = BuddyBoss_BMT_Plugin::instance();
}
Example #2
0
 private function __construct()
 {
     //register internal post type used to handle the member type
     add_action('bp_init', array($this, 'register_post_type'));
     add_action('admin_menu', array($this, 'add_import_menu'));
     add_action('admin_menu', array($this, 'add_help_menu'), 11);
     //register member type
     add_action('bp_register_member_types', array($this, 'register_member_type'));
     add_action('bp_signup_validate', array($this, 'bmt_validate_member_type_field'));
     add_action('bp_core_signup_user', array($this, 'bmt_member_type_on_registration'), 10, 5);
     add_action('bp_core_activated_user', array($this, 'bmt_member_type_on_registration_multisite'), 10, 3);
     add_filter('bp_signup_usermeta', array($this, 'bmt_alter_usermeta'));
     // add setting link
     $buddyboss = BuddyBoss_BMT_Plugin::instance();
     $plugin = $buddyboss->basename;
     add_filter("plugin_action_links_{$plugin}", array($this, 'plugin_settings_link'));
     add_action("admin_init", array($this, 'changing_listing_label'));
     // remove users of a specific member type from members directory
     add_action('bp_ajax_querystring', array($this, 'exclude_users_from_directory_and_searches'), 999, 2);
     // set member type while update user profile
     add_action('profile_update', array($this, 'update_user_member_type_set'), 10, 2);
     // fix all member count
     add_filter('bp_core_get_active_member_count', array($this, 'fixed_all_member_count'), 999);
 }