当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_get_groups_action_link函数代码示例

本文整理汇总了PHP中bp_get_groups_action_link函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_groups_action_link函数的具体用法?PHP bp_get_groups_action_link怎么用?PHP bp_get_groups_action_link使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bp_get_groups_action_link函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bp_groups_group_admin_menu

/**
 * Adds the Group Admin top-level menu to group pages
 *
 * @package BuddyPress
 * @since 1.5
 *
 * @todo Add dynamic menu items for group extensions
 */
function bp_groups_group_admin_menu()
{
    global $nxt_admin_bar, $bp;
    // Only show if viewing a group
    if (!bp_is_group()) {
        return false;
    }
    // Only show this menu to group admins and super admins
    if (!is_super_admin() && !bp_group_is_admin()) {
        return false;
    }
    if ('3.2' == bp_get_major_nxt_version()) {
        // Group avatar
        $avatar = bp_core_fetch_avatar(array('object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'width' => 16, 'height' => 16));
        // Unique ID for the 'My Account' menu
        $bp->group_admin_menu_id = !empty($avatar) ? 'group-admin-with-avatar' : 'group-admin';
        // Add the top-level Group Admin button
        $nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => $avatar . bp_get_current_group_name(), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    } elseif ('3.3' == bp_get_major_nxt_version()) {
        // Unique ID for the 'My Account' menu
        $bp->group_admin_menu_id = 'group-admin';
        // Add the top-level Group Admin button
        $nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    }
    // Group Admin > Edit details
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'edit-details', 'title' => __('Edit Details', 'buddypress'), 'href' => bp_get_groups_action_link('admin/edit-details')));
    // Group Admin > Group settings
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-settings', 'title' => __('Edit Settings', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-settings')));
    // Group Admin > Group avatar
    if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-avatar', 'title' => __('Edit Avatar', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-avatar')));
    }
    // Group Admin > Manage invitations
    if (bp_is_active('friends')) {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-invitations', 'title' => __('Manage Invitations', 'buddypress'), 'href' => bp_get_groups_action_link('send-invites')));
    }
    // Group Admin > Manage members
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-members', 'title' => __('Manage Members', 'buddypress'), 'href' => bp_get_groups_action_link('admin/manage-members')));
    // Group Admin > Membership Requests
    if (bp_get_group_status($bp->groups->current_group) == 'private') {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'membership-requests', 'title' => __('Membership Requests', 'buddypress'), 'href' => bp_get_groups_action_link('admin/membership-requests')));
    }
    // Delete Group
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'delete-group', 'title' => __('Delete Group', 'buddypress'), 'href' => bp_get_groups_action_link('admin/delete-group')));
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:53,代码来源:bp-groups-adminbar.php

示例2: bp_groups_group_admin_menu

/**
 * Add the Group Admin top-level menu when viewing group pages.
 *
 * @since 1.5.0
 *
 * @todo Add dynamic menu items for group extensions.
 *
 * @return false|null False if not on a group page, or if user does not have
 *                    access to group admin options.
 */
function bp_groups_group_admin_menu()
{
    global $wp_admin_bar;
    $bp = buddypress();
    // Only show if viewing a group.
    if (!bp_is_group() || bp_is_group_create()) {
        return false;
    }
    // Only show this menu to group admins and super admins.
    if (!bp_current_user_can('bp_moderate') && !bp_group_is_admin()) {
        return false;
    }
    // Unique ID for the 'Edit Group' menu.
    $bp->group_admin_menu_id = 'group-admin';
    // Add the top-level Group Admin button.
    $wp_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    // Index of the Manage tabs parent slug.
    $nav_index = $bp->groups->current_group->slug . '_manage';
    // Check if current group has Manage tabs.
    if (empty($bp->bp_options_nav[$nav_index])) {
        return;
    }
    // Build the Group Admin menus.
    foreach ($bp->bp_options_nav[$nav_index] as $menu) {
        /**
         * Should we add the current manage link in the Group's "Edit" Admin Bar menu ?
         *
         * All core items will be added, plugins can use a new parameter in the BP Group Extension API
         * to also add the link to the "edit screen" of their group component. To do so, set the
         * the 'show_in_admin_bar' argument of your edit screen to true
         */
        if ($menu['show_in_admin_bar']) {
            $title = sprintf(_x('Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress'), $menu['name']);
            // Title is specific for delete.
            if ('delete-group' == $menu['slug']) {
                $title = sprintf(_x('%s Group', 'Group WP Admin Bar delete link', 'buddypress'), $menu['name']);
            }
            $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => $menu['slug'], 'title' => $title, 'href' => bp_get_groups_action_link('admin/' . $menu['slug'])));
        }
    }
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:51,代码来源:bp-groups-adminbar.php

示例3: bp_groups_group_admin_menu

/**
 * Add the Group Admin top-level menu when viewing group pages.
 *
 * @since BuddyPress (1.5.0)
 *
 * @todo Add dynamic menu items for group extensions.
 */
function bp_groups_group_admin_menu()
{
    global $wp_admin_bar, $bp;
    // Only show if viewing a group
    if (!bp_is_group()) {
        return false;
    }
    // Only show this menu to group admins and super admins
    if (!bp_current_user_can('bp_moderate') && !bp_group_is_admin()) {
        return false;
    }
    // Unique ID for the 'Edit Group' menu
    $bp->group_admin_menu_id = 'group-admin';
    // Add the top-level Group Admin button
    $wp_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    // Group Admin > Edit details
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'edit-details', 'title' => __('Edit Details', 'buddypress'), 'href' => bp_get_groups_action_link('admin/edit-details')));
    // Group Admin > Group settings
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-settings', 'title' => __('Edit Settings', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-settings')));
    // Group Admin > Group avatar
    if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
        $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-avatar', 'title' => __('Edit Avatar', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-avatar')));
    }
    // Group Admin > Manage invitations
    if (bp_is_active('friends')) {
        $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-invitations', 'title' => __('Manage Invitations', 'buddypress'), 'href' => bp_get_groups_action_link('send-invites')));
    }
    // Group Admin > Manage members
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-members', 'title' => __('Manage Members', 'buddypress'), 'href' => bp_get_groups_action_link('admin/manage-members')));
    // Group Admin > Membership Requests
    if (bp_get_group_status($bp->groups->current_group) == 'private') {
        $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'membership-requests', 'title' => __('Membership Requests', 'buddypress'), 'href' => bp_get_groups_action_link('admin/membership-requests')));
    }
    // Delete Group
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'delete-group', 'title' => __('Delete Group', 'buddypress'), 'href' => bp_get_groups_action_link('admin/delete-group')));
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:43,代码来源:bp-groups-adminbar.php

示例4: bp_groups_action_link

function bp_groups_action_link($action = '', $query_args = '', $nonce = false)
{
    echo bp_get_groups_action_link($action, $query_args, $nonce);
}
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:4,代码来源:bp-groups-template.php

示例5: ass_admin_notice_form

function ass_admin_notice_form()
{
    global $bp;
    if (groups_is_user_admin(bp_loggedin_user_id(), bp_get_current_group_id()) || is_super_admin()) {
        $submit_link = bp_get_groups_action_link('notifications');
        ?>
		<form action="<?php 
        echo $submit_link;
        ?>
" method="post">
			<?php 
        wp_nonce_field('ass_email_options');
        ?>

			<h3><?php 
        _e('Send an email notice to everyone in the group', 'bp-ass');
        ?>
</h3>
			<p><?php 
        _e('You can use the form below to send an email notice to all group members.', 'bp-ass');
        ?>
 <br>
			<b><?php 
        _e('Everyone in the group will receive the email -- regardless of their email settings -- so use with caution', 'bp-ass');
        ?>
</b>.</p>

			<p>
				<label for="ass-admin-notice-subject"><?php 
        _e('Email Subject:', 'bp-ass');
        ?>
</label>
				<input type="text" name="ass_admin_notice_subject" id="ass-admin-notice-subject" value="" />
			</p>

			<p>
				<label for="ass-admin-notice-textarea"><?php 
        _e('Email Content:', 'bp-ass');
        ?>
</label>
				<textarea value="" name="ass_admin_notice" id="ass-admin-notice-textarea"></textarea>
			</p>

			<p>
				<input type="submit" name="ass_admin_notice_send" value="<?php 
        _e('Email this notice to everyone in the group', 'bp-ass');
        ?>
" />
			</p>

			<br />

			<?php 
        $welcome_email = groups_get_groupmeta(bp_get_current_group_id(), 'ass_welcome_email');
        ?>
			<?php 
        $welcome_email_enabled = isset($welcome_email['enabled']) ? $welcome_email['enabled'] : '';
        ?>

			<h3><?php 
        _e('Welcome Email', 'bp-ass');
        ?>
</h3>
			<p><?php 
        _e('Send an email when a new member join the group.', 'bp-ass');
        ?>
</p>

			<p>
				<label>
					<input<?php 
        checked($welcome_email_enabled, 'yes');
        ?>
 type="checkbox" name="ass_welcome_email[enabled]" id="ass-welcome-email-enabled" value="yes" />
					<?php 
        _e('Enable welcome email', 'bp-ass');
        ?>
				</label>
			</p>

			<p class="ass-welcome-email-field<?php 
        if ($welcome_email_enabled != 'yes') {
            echo ' hide-if-js';
        }
        ?>
">
				<label for="ass-welcome-email-subject"><?php 
        _e('Email Subject:', 'bp-ass');
        ?>
</label>
				<input value="<?php 
        echo isset($welcome_email['subject']) ? $welcome_email['subject'] : '';
        ?>
" type="text" name="ass_welcome_email[subject]" id="ass-welcome-email-subject" />
			</p>

			<p class="ass-welcome-email-field<?php 
        if ($welcome_email_enabled != 'yes') {
            echo ' hide-if-js';
        }
//.........这里部分代码省略.........
开发者ID:pausaura,项目名称:agora_nodes,代码行数:101,代码来源:bp-activity-subscription-functions.php

示例6: bplf_get_feed_url

/**
 * Returns the RSS feed URL.
 *
 * @since 1.0
 */
function bplf_get_feed_url()
{
    global $this_bp_feed;
    switch ($this_bp_feed) {
        case 'member_comments':
            $url = bp_displayed_user_domain() . bp_get_activity_slug() . '/comments/feed/';
            break;
        case 'member_blog_posts':
            $url = bp_displayed_user_domain() . bp_get_activity_slug() . '/blogposts/feed/';
            break;
        case 'member_updates':
            $url = bp_displayed_user_domain() . bp_get_activity_slug() . '/updates/feed/';
            break;
        case 'friendships':
            $url = bp_displayed_user_domain() . bp_get_activity_slug() . '/friendships/feed/';
            break;
        case 'member_topics':
            $url = bp_displayed_user_domain() . bp_get_activity_slug() . '/forumtopics/feed/';
            break;
        case 'member_replies':
            $url = bp_displayed_user_domain() . bp_get_activity_slug() . '/forumreplies/feed/';
            break;
        case 'member_forums':
            $url = bp_displayed_user_domain() . bp_get_activity_slug() . '/forums/feed/';
            break;
        case 'group_updates':
            $url = bp_get_groups_action_link('updates/feed');
            break;
        case 'group_topics':
            $url = bp_get_groups_action_link('forumtopics/feed');
            break;
        case 'group_topics':
            $url = bp_get_groups_action_link('forumreplies/feed');
            break;
        case 'group_forums':
            $url = bp_get_groups_action_link('forums/feed');
            break;
        case 'group_membership':
            $url = bp_get_groups_action_link('membership/feed');
            break;
        case 'forum_topic':
            $url = bp_get_groups_action_link('forum/topic/' . bp_action_variable(1) . '/feed');
            break;
    }
    return apply_filters('bplf_feed_url', $url);
}
开发者ID:r-a-y,项目名称:bp-lotsa-feeds,代码行数:51,代码来源:bp-lotsa-feeds.php


注:本文中的bp_get_groups_action_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。