本文整理汇总了PHP中bp_group_has_requested_membership函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_group_has_requested_membership函数的具体用法?PHP bp_group_has_requested_membership怎么用?PHP bp_group_has_requested_membership使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_group_has_requested_membership函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_group_status_message
/**
* Prints a message if the group is not visible to the current user (it is a
* hidden or private group, and the user does not have access).
*
* @global BP_Groups_Template $groups_template Groups template object
* @param object $group Group to get status message for. Optional; defaults to current group.
* @since BuddyPress (1.0)
*/
function bp_group_status_message($group = null)
{
global $groups_template;
if (!$group) {
$group =& $groups_template->group;
}
if ('private' == $group->status) {
if (!bp_group_has_requested_membership()) {
if (is_user_logged_in()) {
$message = __('This is a private group and you must request group membership in order to join.', 'buddypress');
} else {
$message = __('This is a private group. To join you must be a registered site member and request group membership.', 'buddypress');
}
} else {
$message = __('This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress');
}
} else {
$message = __('This is a hidden group and only invited members can join.', 'buddypress');
}
echo apply_filters('bp_group_status_message', $message, $group);
}
示例2: do_action
<?php
do_action('bp_before_group_request_membership_content');
?>
<?php
if (!bp_group_has_requested_membership()) {
?>
<p><?php
printf(__("You are requesting to become a member of the group '%s'.", "buddypress"), bp_get_group_name(false));
?>
</p>
<form action="<?php
bp_group_form_action('request-membership');
?>
" method="post" name="request-membership-form" id="request-membership-form" class="standard-form">
<label for="group-request-membership-comments"><?php
_e('Comments (optional)', 'buddypress');
?>
</label>
<textarea name="group-request-membership-comments" id="group-request-membership-comments"></textarea>
<?php
do_action('bp_group_request_membership_content');
?>
<p><input type="submit" name="group-request-send" id="group-request-send" value="<?php
_e('Send Request', 'buddypress');
?>
→" />
示例3: bp_group_status_message
/**
* Prints a message if the group is not visible to the current user (it is a
* hidden or private group, and the user does not have access).
*
* @since 1.0.0
*
* @global BP_Groups_Template $groups_template Groups template object.
*
* @param object|null $group Group to get status message for. Optional; defaults to current group.
*/
function bp_group_status_message($group = null)
{
global $groups_template;
// Group not passed so look for loop.
if (empty($group)) {
$group =& $groups_template->group;
}
// Group status is not set (maybe outside of group loop?).
if (empty($group->status)) {
$message = __('This group is not currently accessible.', 'buddypress');
// Group has a status.
} else {
switch ($group->status) {
// Private group.
case 'private':
if (!bp_group_has_requested_membership($group)) {
if (is_user_logged_in()) {
if (bp_group_is_invited($group)) {
$message = __('You must accept your pending invitation before you can access this private group.', 'buddypress');
} else {
$message = __('This is a private group and you must request group membership in order to join.', 'buddypress');
}
} else {
$message = __('This is a private group. To join you must be a registered site member and request group membership.', 'buddypress');
}
} else {
$message = __('This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress');
}
break;
// Hidden group.
// Hidden group.
case 'hidden':
default:
$message = __('This is a hidden group and only invited members can join.', 'buddypress');
break;
}
}
/**
* Filters a message if the group is not visible to the current user.
*
* This will be true if it is a hidden or private group, and the user does not have access.
*
* @since 1.6.0
*
* @param string $message Message to display to the current user.
* @param object $group Group to get status message for.
*/
echo apply_filters('bp_group_status_message', $message, $group);
}