當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_Groups_Member::get_is_admin_of方法代碼示例

本文整理匯總了PHP中BP_Groups_Member::get_is_admin_of方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Groups_Member::get_is_admin_of方法的具體用法?PHP BP_Groups_Member::get_is_admin_of怎麽用?PHP BP_Groups_Member::get_is_admin_of使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BP_Groups_Member的用法示例。


在下文中一共展示了BP_Groups_Member::get_is_admin_of方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: set_up_user_groups

 /**
  * Get a list of a user's groups, as well as those groups of which
  * the user is an admin or mod
  *
  * @since 1.2
  */
 protected function set_up_user_groups()
 {
     $groups = BP_Groups_Member::get_group_ids($this->user_id);
     $this->user_groups['groups'] = $groups['groups'];
     $admin_groups = BP_Groups_Member::get_is_admin_of($this->user_id);
     $mod_groups = BP_Groups_Member::get_is_mod_of($this->user_id);
     $this->user_groups['admin_mod_of'] = array_merge(wp_list_pluck($admin_groups['groups'], 'id'), wp_list_pluck($mod_groups['groups'], 'id'));
 }
開發者ID:adisonc,項目名稱:MaineLearning,代碼行數:14,代碼來源:access-query.php

示例2: test_get_is_admin_of_with_filter

 public function test_get_is_admin_of_with_filter()
 {
     $g1 = $this->factory->group->create(array('name' => 'RC Cola'));
     $g2 = $this->factory->group->create(array('name' => 'Pepsi'));
     $u = $this->factory->user->create();
     self::add_user_to_group($u, $g1);
     self::add_user_to_group($u, $g2);
     $m1 = new BP_Groups_Member($u, $g1);
     $m1->promote('admin');
     $m2 = new BP_Groups_Member($u, $g2);
     $m2->promote('admin');
     $groups = BP_Groups_Member::get_is_admin_of($u, false, false, 'eps');
     $ids = wp_list_pluck($groups['groups'], 'id');
     $this->assertEquals($ids, array($g2));
 }
開發者ID:jasonmcalpin,項目名稱:BuddyPress,代碼行數:15,代碼來源:class-bp-groups-member.php

示例3: bpfb_documents_allowed

/**
 * Checks upload permissions.
 * Adapted from Group Documents plugin.
 */
function bpfb_documents_allowed($group = false)
{
    if (!$group) {
        return false;
    }
    $user = wp_get_current_user();
    $moderator_of = BP_Groups_Member::get_is_admin_of($user->ID) + BP_Groups_Member::get_is_mod_of($user->ID);
    $moderator_of = is_array($moderator_of) && isset($moderator_of['groups']) ? $moderator_of['groups'] : false;
    $is_mod = false;
    foreach ($moderator_of as $gm) {
        if ($gm->id == $group->id) {
            $is_mod = true;
            break;
        }
    }
    switch (get_option('bp_group_documents_upload_permission')) {
        case 'mods_decide':
            switch (groups_get_groupmeta($group->id, 'group_documents_upload_permission')) {
                case 'mods_only':
                    if ($is_mod) {
                        return true;
                    }
                    break;
                case 'members':
                default:
                    if (bp_group_is_member($group)) {
                        return true;
                    }
                    break;
            }
            break;
        case 'mods_only':
            if ($is_mod) {
                return true;
            }
            break;
        case 'members':
        default:
            if (bp_group_is_member($group)) {
                return true;
            }
            break;
    }
    return false;
}
開發者ID:netconstructor,項目名稱:buddypress-activity-plus,代碼行數:49,代碼來源:bpfb_group_documents.php

示例4: groups_get_user_is_admin_of

function groups_get_user_is_admin_of($user_id = false, $pag_num = false, $pag_page = false, $filter = false)
{
    global $bp;
    if (!$user_id) {
        $user_id = $bp->displayed_user->id;
    }
    return BP_Groups_Member::get_is_admin_of($user_id, $pag_num, $pag_page, $filter);
}
開發者ID:alvaropereyra,項目名稱:shrekcms,代碼行數:8,代碼來源:bp-groups.php

示例5: single_row


//.........這裏部分代碼省略.........
             case 'cb':
                 $r .= "<th scope='row' class='check-column'>{$checkbox}</th>";
                 break;
             case 'info':
                 add_thickbox();
                 if (!is_multisite()) {
                     $url = esc_url(admin_url(add_query_arg(array('page' => 'wangguard_users_info'), 'admin.php')));
                 } else {
                     $url = esc_url(network_admin_url(add_query_arg(array('page' => 'wangguard_users_info'), 'admin.php')));
                 }
                 $arrayUrl = array('userID' => $row_data->ID, 'userIP' => $row_data->user_ip, '?TB_iframe' => 'true', 'width' => '900', 'height' => '550');
                 $final_user_info_url = esc_url(add_query_arg($arrayUrl, $url));
                 $r .= "<td  width='25'><a class='thickbox' title='" . __('Info about', 'wangguard') . "  {$row_data->first_name} {$row_data->last_name}' href='" . $final_user_info_url . "'><img class='alignnone size-full wp-image-2055' alt='Info about {$row_data->first_name} {$row_data->last_name}' src='" . plugins_url('img/info-wgg.png', __FILE__) . "' width='15' height='15' /> " . __('User Info', 'wangguard') . "</a>";
                 break;
             case 'username':
                 $r .= "<td {$attributes}>{$avatar} {$report} <span style='font-size:11px'>{$role}" . ($actions ? $this->row_actions($actions) : "") . "</span></td>";
                 break;
             case 'name':
                 $r .= "<td {$attributes}>{$row_data->first_name} {$row_data->last_name}</td>";
                 break;
             case 'email':
                 $r .= "<td {$attributes}><a href='mailto:{$email}' title='" . esc_attr(sprintf(__('E-mail: %s'), $email)) . "'>{$email}</a></td>";
                 break;
             case 'user_registered':
                 $r .= "<td {$attributes}><span style='font-size:11px'>" . date(get_option('date_format'), strtotime($row_data->user_registered)) . " " . date(get_option('time_format'), strtotime($row_data->user_registered)) . "</span></td>";
                 break;
             case 'from_ip':
                 $r .= "<td {$attributes}>";
                 $r .= "<div class='wangguard-user-ip' data='{$row_data->user_ip}'><span class='wangguard-user-ip-bb'>";
                 $r .= $row_data->user_ip;
                 $r .= '</span>';
                 if ($row_data->user_ip_is_proxy) {
                     $r .= " <span class='wangguard_proxy'>" . __('proxy', 'wangguard') . "</span>";
                 }
                 $r .= "</div>";
                 if (!empty($row_data->user_reported_proxy_ip)) {
                     $r .= "<div class='wangguard-user-ip' data='{$row_data->user_reported_proxy_ip}'><span class='wangguard-user-ip-bb'>";
                     $r .= $row_data->user_reported_proxy_ip;
                     $r .= '</span>';
                     $r .= " <span class='wangguard_proxy'>" . __('reported proxy', 'wangguard') . "</span>";
                     $r .= "</div>";
                 }
                 $r .= "</td>";
                 break;
             case 'posts':
                 $attributes = 'class="posts column-posts num"' . $style;
                 $r .= "<td {$attributes}>";
                 if ($numposts > 0) {
                     $r .= "<a target='_blank' href='edit.php?author={$row_data->ID}' title='" . esc_attr__('View posts by this author') . "' class='edit'>";
                     $r .= $numposts;
                     $r .= '</a>';
                 } else {
                     $r .= 0;
                 }
                 $r .= "</td>";
                 break;
             case 'blogs':
                 add_thickbox();
                 $r .= "<td {$attributes}>";
                 if (function_exists("get_blogs_of_user")) {
                     $blogs = @get_blogs_of_user($row_data->ID, true);
                     if (is_array($blogs)) {
                         foreach ((array) $blogs as $key => $details) {
                             $r .= '- <a href="' . $details->siteurl . '?TB_iframe=true&width=900&height=550" class="thickbox" title="' . htmlentities($details->siteurl, 0, 'UTF-8') . '">' . $details->blogname . '</a><br/>';
                         }
                     }
                 }
                 $r .= "</td>";
                 break;
             case 'groups':
                 add_thickbox();
                 $r .= "<td {$attributes}>";
                 if (defined('BP_VERSION') && class_exists('BP_Groups_member')) {
                     global $bp;
                     $bpgrpupsslug = $bp->groups->root_slug;
                     $groups = BP_Groups_Member::get_is_admin_of($row_data->ID);
                     foreach ($groups as $group) {
                         if (is_array($group)) {
                             foreach ($group as $detail) {
                                 $groupdomain = $bp->root_domain;
                                 $bpgroupsslug = $bp->groups->root_slug;
                                 $groupslug = $detail->slug;
                                 $groupname = $detail->name;
                                 $r .= '- <a href="' . $groupdomain . '/' . $bpgroupsslug . '/' . $groupslug . '/?TB_iframe=true&width=900&height=550" class="thickbox" title="' . htmlentities($groupdomain . '/' . $bpgrpupsslug . '/' . $groupslug, 0, 'UTF-8') . '">' . $groupname . '</a><br/>';
                             }
                         } else {
                             continue;
                         }
                     }
                 }
                 $r .= "</td>";
                 break;
             case 'wgstatus':
                 $r .= "<td {$attributes}>" . $statushtml . "</td>";
                 break;
         }
     }
     $r .= '</tr>';
     return $r;
 }
開發者ID:kd5ytx,項目名稱:Empirical-Wordpress,代碼行數:101,代碼來源:wangguard-class-wp-users.php

示例6: bfox_bp_plans_user_owner_options

function bfox_bp_plans_user_owner_options($user_id = 0)
{
    if (!$user_id) {
        $user_id = $GLOBALS['user_ID'];
    }
    $results = BP_Groups_Member::get_is_admin_of($user_id);
    $options = array();
    foreach ((array) $results['groups'] as $group) {
        $id = BfoxOwnedObject::owner_type_group . '-' . $group->id;
        $options[$id] = stripslashes($group->name);
    }
    return $options;
}
開發者ID:jeffryevans,項目名稱:biblefox-wp,代碼行數:13,代碼來源:plans-directory.php


注:本文中的BP_Groups_Member::get_is_admin_of方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。