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


PHP bp_get_group_current_admin_tab函数代码示例

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


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

示例1: bp_attachments_cover_image_is_edit

/**
 * Are we on a page to edit a cover image ?
 *
 * @since  2.4.0
 *
 * @return bool True if on a page to edit a cover image, false otherwise
 */
function bp_attachments_cover_image_is_edit()
{
    $retval = false;
    $current_component = bp_current_component();
    if ('profile' === $current_component) {
        $current_component = 'xprofile';
    }
    if (!bp_is_active($current_component, 'cover_image')) {
        return $retval;
    }
    if (bp_is_user_change_cover_image()) {
        $retval = !bp_disable_cover_image_uploads();
    }
    if (bp_is_group_admin_page() && 'group-cover-image' == bp_get_group_current_admin_tab() || bp_is_group_create() && bp_is_group_creation_step('group-cover-image')) {
        $retval = !bp_disable_group_cover_image_uploads();
    }
    return apply_filters('bp_attachments_cover_image_is_edit', $retval, $current_component);
}
开发者ID:mawilliamson,项目名称:wordpress,代码行数:25,代码来源:bp-core-attachments.php

示例2: bp_group_current_admin_tab

/**
 * Echoes the current group admin tab slug
 *
 * @since BuddyPress (1.6)
 */
function bp_group_current_admin_tab()
{
    echo bp_get_group_current_admin_tab();
}
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:9,代码来源:bp-groups-template.php

示例3: bp_get_the_body_class


//.........这里部分代码省略.........
        $bp_classes[] = 'profile-edit';
    }
    if (bp_is_user_friends_activity()) {
        $bp_classes[] = 'friends-activity';
    }
    if (bp_is_user_groups_activity()) {
        $bp_classes[] = 'groups-activity';
    }
    /* Messages **********************************************************/
    if (bp_is_messages_inbox()) {
        $bp_classes[] = 'inbox';
    }
    if (bp_is_messages_sentbox()) {
        $bp_classes[] = 'sentbox';
    }
    if (bp_is_messages_compose_screen()) {
        $bp_classes[] = 'compose';
    }
    if (bp_is_notices()) {
        $bp_classes[] = 'notices';
    }
    if (bp_is_user_friend_requests()) {
        $bp_classes[] = 'friend-requests';
    }
    if (bp_is_create_blog()) {
        $bp_classes[] = 'create-blog';
    }
    /* Groups ************************************************************/
    if (bp_is_group()) {
        $bp_classes[] = 'group-' . groups_get_current_group()->slug;
        // Add current group types.
        if ($group_types = bp_groups_get_group_type(bp_get_current_group_id(), false)) {
            foreach ($group_types as $group_type) {
                $bp_classes[] = sprintf('group-type-%s', esc_attr($group_type));
            }
        }
    }
    if (bp_is_group_leave()) {
        $bp_classes[] = 'leave-group';
    }
    if (bp_is_group_invites()) {
        $bp_classes[] = 'group-invites';
    }
    if (bp_is_group_members()) {
        $bp_classes[] = 'group-members';
    }
    if (bp_is_group_forum_topic()) {
        $bp_classes[] = 'group-forum-topic';
    }
    if (bp_is_group_forum_topic_edit()) {
        $bp_classes[] = 'group-forum-topic-edit';
    }
    if (bp_is_group_forum()) {
        $bp_classes[] = 'group-forum';
    }
    if (bp_is_group_admin_page()) {
        $bp_classes[] = 'group-admin';
        $bp_classes[] = bp_get_group_current_admin_tab();
    }
    if (bp_is_group_create()) {
        $bp_classes[] = 'group-create';
        $bp_classes[] = bp_get_groups_current_create_step();
    }
    if (bp_is_group_home()) {
        $bp_classes[] = 'group-home';
    }
    if (bp_is_single_activity()) {
        $bp_classes[] = 'activity-permalink';
    }
    /* Registration ******************************************************/
    if (bp_is_register_page()) {
        $bp_classes[] = 'registration';
    }
    if (bp_is_activation_page()) {
        $bp_classes[] = 'activation';
    }
    /* Current Component & Action ****************************************/
    if (!bp_is_blog_page()) {
        $bp_classes[] = bp_current_component();
        $bp_classes[] = bp_current_action();
    }
    /* Clean up ***********************************************************/
    // Add BuddyPress class if we are within a BuddyPress page.
    if (!bp_is_blog_page()) {
        $bp_classes[] = 'buddypress';
    }
    // Merge WP classes with BuddyPress classes and remove any duplicates.
    $classes = array_unique(array_merge((array) $bp_classes, (array) $wp_classes));
    /**
     * Filters the BuddyPress classes to be added to body_class()
     *
     * @since 1.1.0
     *
     * @param array $classes        Array of body classes to add.
     * @param array $bp_classes     Array of BuddyPress-based classes.
     * @param array $wp_classes     Array of WordPress-based classes.
     * @param array $custom_classes Array of classes that were passed to get_body_class().
     */
    return apply_filters('bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes);
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:101,代码来源:bp-core-template.php

示例4: groups_screen_group_admin_delete_group

/**
 * Handle the display of the Delete Group page.
 */
function groups_screen_group_admin_delete_group()
{
    if ('delete-group' != bp_get_group_current_admin_tab()) {
        return false;
    }
    if (!bp_is_item_admin() && !bp_current_user_can('bp_moderate')) {
        return false;
    }
    $bp = buddypress();
    if (isset($_REQUEST['delete-group-button']) && isset($_REQUEST['delete-group-understand'])) {
        // Check the nonce first.
        if (!check_admin_referer('groups_delete_group')) {
            return false;
        }
        /**
         * Fires before the deletion of a group from the Delete Group page.
         *
         * @since 1.5.0
         *
         * @param int $id ID of the group being deleted.
         */
        do_action('groups_before_group_deleted', $bp->groups->current_group->id);
        // Group admin has deleted the group, now do it.
        if (!groups_delete_group($bp->groups->current_group->id)) {
            bp_core_add_message(__('There was an error deleting the group. Please try again.', 'buddypress'), 'error');
        } else {
            bp_core_add_message(__('The group was deleted successfully.', 'buddypress'));
            /**
             * Fires after the deletion of a group from the Delete Group page.
             *
             * @since 1.0.0
             *
             * @param int $id ID of the group being deleted.
             */
            do_action('groups_group_deleted', $bp->groups->current_group->id);
            bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_get_groups_slug()));
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_get_groups_slug()));
    }
    /**
     * Fires before the loading of the Delete Group page template.
     *
     * @since 1.0.0
     *
     * @param int $id ID of the group that is being displayed.
     */
    do_action('groups_screen_group_admin_delete_group', $bp->groups->current_group->id);
    /**
     * Filters the template to load for the Delete Group page.
     *
     * @since 1.0.0
     *
     * @param string $value Path to the Delete Group template.
     */
    bp_core_load_template(apply_filters('groups_template_group_admin_delete_group', 'groups/single/home'));
}
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:59,代码来源:bp-groups-screens.php

示例5: groups_screen_group_admin_delete_group

/**
 * Handle the display of the Delete Group page.
 */
function groups_screen_group_admin_delete_group()
{
    global $bp;
    if ('delete-group' != bp_get_group_current_admin_tab()) {
        return false;
    }
    if (!bp_is_item_admin() && !bp_current_user_can('bp_moderate')) {
        return false;
    }
    if (isset($_REQUEST['delete-group-button']) && isset($_REQUEST['delete-group-understand'])) {
        // Check the nonce first.
        if (!check_admin_referer('groups_delete_group')) {
            return false;
        }
        do_action('groups_before_group_deleted', $bp->groups->current_group->id);
        // Group admin has deleted the group, now do it.
        if (!groups_delete_group($bp->groups->current_group->id)) {
            bp_core_add_message(__('There was an error deleting the group. Please try again.', 'buddypress'), 'error');
        } else {
            bp_core_add_message(__('The group was deleted successfully', 'buddypress'));
            do_action('groups_group_deleted', $bp->groups->current_group->id);
            bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_get_groups_slug()));
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_get_groups_slug()));
    }
    do_action('groups_screen_group_admin_delete_group', $bp->groups->current_group->id);
    bp_core_load_template(apply_filters('groups_template_group_admin_delete_group', 'groups/single/home'));
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:31,代码来源:bp-groups-screens.php

示例6: bp_get_the_body_class


//.........这里部分代码省略.........
    }
    if (bp_is_user_change_avatar()) {
        $bp_classes[] = 'change-avatar';
    }
    if (bp_is_user_profile_edit()) {
        $bp_classes[] = 'profile-edit';
    }
    if (bp_is_user_friends_activity()) {
        $bp_classes[] = 'friends-activity';
    }
    if (bp_is_user_groups_activity()) {
        $bp_classes[] = 'groups-activity';
    }
    if (is_user_logged_in()) {
        $bp_classes[] = 'logged-in';
    }
    /** Messages **********************************************************/
    if (bp_is_messages_inbox()) {
        $bp_classes[] = 'inbox';
    }
    if (bp_is_messages_sentbox()) {
        $bp_classes[] = 'sentbox';
    }
    if (bp_is_messages_compose_screen()) {
        $bp_classes[] = 'compose';
    }
    if (bp_is_notices()) {
        $bp_classes[] = 'notices';
    }
    if (bp_is_user_friend_requests()) {
        $bp_classes[] = 'friend-requests';
    }
    if (bp_is_create_blog()) {
        $bp_classes[] = 'create-blog';
    }
    /** Groups ************************************************************/
    if (bp_is_group_leave()) {
        $bp_classes[] = 'leave-group';
    }
    if (bp_is_group_invites()) {
        $bp_classes[] = 'group-invites';
    }
    if (bp_is_group_members()) {
        $bp_classes[] = 'group-members';
    }
    if (bp_is_group_forum_topic()) {
        $bp_classes[] = 'group-forum-topic';
    }
    if (bp_is_group_forum_topic_edit()) {
        $bp_classes[] = 'group-forum-topic-edit';
    }
    if (bp_is_group_forum()) {
        $bp_classes[] = 'group-forum';
    }
    if (bp_is_group_admin_page()) {
        $bp_classes[] = 'group-admin';
        $bp_classes[] = bp_get_group_current_admin_tab();
    }
    if (bp_is_group_create()) {
        $bp_classes[] = 'group-create';
        $bp_classes[] = bp_get_groups_current_create_step();
    }
    if (bp_is_group_home()) {
        $bp_classes[] = 'group-home';
    }
    if (bp_is_single_activity()) {
        $bp_classes[] = 'activity-permalink';
    }
    /** Registration ******************************************************/
    if (bp_is_register_page()) {
        $bp_classes[] = 'registration';
    }
    if (bp_is_activation_page()) {
        $bp_classes[] = 'activation';
    }
    /** Current Component & Action ****************************************/
    if (!bp_is_blog_page()) {
        $bp_classes[] = bp_current_component();
        $bp_classes[] = bp_current_action();
    }
    /** Clean up***********************************************************/
    // We don't want WordPress blog classes to appear on non-blog pages.
    if (!bp_is_blog_page()) {
        // Observe WP custom background body class
        if (in_array('custom-background', (array) $wp_classes)) {
            $bp_classes[] = 'custom-background';
        }
        // Preserve any custom classes already set
        if (!empty($custom_classes)) {
            $wp_classes = (array) $custom_classes;
        } else {
            $wp_classes = array();
        }
    }
    // Merge WP classes with BP classes
    $classes = array_merge((array) $bp_classes, (array) $wp_classes);
    // Remove any duplicates
    $classes = array_unique($classes);
    return apply_filters('bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes);
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:101,代码来源:bp-core-template.php

示例7: group_actions

 /**
  * Handles group's moderating actions about ideas
  *
  * @package WP Idea Stream
  * @subpackage buddypress/groups
  *
  * @since  2.0.0
  *
  * @uses bp_is_group() to check a group is displayed
  * @uses bp_is_current_action() to check the group's current action
  * @uses wp_idea_stream_root_slug() to get the IdeaStream root slug
  * @uses wp_idea_stream_action_get_slug() to get the IdeaStream's action slug
  * @uses bp_action_variable() to get a specific action variable
  * @uses groups_get_current_group() to get the current group's object
  * @uses WP_Idea_Stream_Group->group_ideas_archive_url() to get the group's IdeaStream archive page
  * @uses check_admin_referer() to check the request was made on the site
  * @uses wp_idea_stream_user_can() to check user's capability
  * @uses WP_Idea_Stream_Group->remove_from_group() to remove one or more ideas from a group
  * @uses wp_get_referer() to get the url the user came from
  * @uses wp_spam_comment() to spam a comment made on an idea
  * @uses wp_trash_comment() to trash a comment made on an idea
  * @uses wp_idea_stream_add_message() to add a feedback to display to the user once redirected
  * @uses bp_core_redirect() to safely redirect the user
  */
 public function group_actions()
 {
     if (!bp_is_group()) {
         return;
     }
     $group = groups_get_current_group();
     // This part is to catch the group status before it might be updated
     if ('group-settings' == bp_get_group_current_admin_tab() && bp_is_item_admin()) {
         $this->group_update_ideas_stati = $group;
         if (!empty($_POST['group-status']) && in_array($_POST['group-status'], array('public', 'private', 'hidden'))) {
             $this->group_update_ideas_stati->new_status = $_POST['group-status'];
         }
     }
     // This part is for ideastream moderation actions.
     if (!(bp_is_current_action(wp_idea_stream_root_slug()) && wp_idea_stream_action_get_slug() == bp_action_variable(0) && bp_action_variable(1))) {
         return;
     }
     $feedback = array();
     // Default to group's home
     $redirect = $this->group_ideas_archive_url($group, true);
     switch (bp_action_variable(1)) {
         case 'remove-idea':
             check_admin_referer('group-remove-idea');
             if (!bp_action_variable(2)) {
                 $feedback['type'] = 'error';
                 $feedback['content'] = __('Removing the idea failed.', 'wp-idea-stream');
                 break;
             }
             $idea_id = absint(bp_action_variable(2));
             if (!wp_idea_stream_user_can('remove_group_ideas')) {
                 $feedback['type'] = 'error';
                 $feedback['content'] = __('Removing the idea failed. You do not have the capability to remove ideas.', 'wp-idea-stream');
                 break;
             }
             if (false === $this->remove_from_group($idea_id, $group->id)) {
                 $feedback['type'] = 'error';
                 $feedback['content'] = __('Removing the idea failed.', 'wp-idea-stream');
                 $redirect = wp_get_referer();
             } else {
                 $feedback['type'] = 'success';
                 $feedback['content'] = __('The idea was successfully removed.', 'wp-idea-stream');
             }
             break;
         case 'spam-comment':
             check_admin_referer('group-spam-comment');
             $redirect = wp_get_referer();
             if (!bp_action_variable(2)) {
                 $feedback['type'] = 'error';
                 $feedback['content'] = __('Spamming the comment failed.', 'wp-idea-stream');
                 break;
             }
             $comment_id = absint(bp_action_variable(2));
             if (!wp_idea_stream_user_can('spam_group_idea_comments')) {
                 $feedback['type'] = 'error';
                 $feedback['content'] = __('Spamming the comment failed. You do not have the capability to spam comments.', 'wp-idea-stream');
                 break;
             }
             if (false === wp_spam_comment($comment_id)) {
                 $feedback['type'] = 'error';
                 $feedback['content'] = __('Spamming the comment failed.', 'wp-idea-stream');
             } else {
                 $feedback['type'] = 'success';
                 $feedback['content'] = __('The comment was successfully marked as spam.', 'wp-idea-stream');
             }
             break;
         case 'trash-comment':
             check_admin_referer('group-trash-comment');
             $redirect = wp_get_referer();
             if (!bp_action_variable(2)) {
                 $feedback['type'] = 'error';
                 $feedback['content'] = __('Deleting the comment failed.', 'wp-idea-stream');
                 break;
             }
             $comment_id = absint(bp_action_variable(2));
             if (!wp_idea_stream_user_can('trash_group_idea_comments')) {
                 $feedback['type'] = 'error';
//.........这里部分代码省略.........
开发者ID:mrjarbenne,项目名称:wp-idea-stream,代码行数:101,代码来源:groups.php

示例8: bp_get_the_body_class


//.........这里部分代码省略.........
    if (bp_is_user_friends()) {
        $bp_classes[] = 'my-friends';
    }
    if (bp_is_user_messages()) {
        $bp_classes[] = 'my-messages';
    }
    if (bp_is_user_recent_commments()) {
        $bp_classes[] = 'recent-comments';
    }
    if (bp_is_user_recent_posts()) {
        $bp_classes[] = 'recent-posts';
    }
    if (bp_is_user_change_avatar()) {
        $bp_classes[] = 'change-avatar';
    }
    if (bp_is_user_profile_edit()) {
        $bp_classes[] = 'profile-edit';
    }
    if (bp_is_user_friends_activity()) {
        $bp_classes[] = 'friends-activity';
    }
    if (bp_is_user_groups_activity()) {
        $bp_classes[] = 'groups-activity';
    }
    /** Messages **********************************************************/
    if (bp_is_messages_inbox()) {
        $bp_classes[] = 'inbox';
    }
    if (bp_is_messages_sentbox()) {
        $bp_classes[] = 'sentbox';
    }
    if (bp_is_messages_compose_screen()) {
        $bp_classes[] = 'compose';
    }
    if (bp_is_notices()) {
        $bp_classes[] = 'notices';
    }
    if (bp_is_user_friend_requests()) {
        $bp_classes[] = 'friend-requests';
    }
    if (bp_is_create_blog()) {
        $bp_classes[] = 'create-blog';
    }
    /** Groups ************************************************************/
    if (bp_is_group()) {
        $bp_classes[] = 'group-' . groups_get_current_group()->slug;
    }
    if (bp_is_group_leave()) {
        $bp_classes[] = 'leave-group';
    }
    if (bp_is_group_invites()) {
        $bp_classes[] = 'group-invites';
    }
    if (bp_is_group_members()) {
        $bp_classes[] = 'group-members';
    }
    if (bp_is_group_forum_topic()) {
        $bp_classes[] = 'group-forum-topic';
    }
    if (bp_is_group_forum_topic_edit()) {
        $bp_classes[] = 'group-forum-topic-edit';
    }
    if (bp_is_group_forum()) {
        $bp_classes[] = 'group-forum';
    }
    if (bp_is_group_admin_page()) {
        $bp_classes[] = 'group-admin';
        $bp_classes[] = bp_get_group_current_admin_tab();
    }
    if (bp_is_group_create()) {
        $bp_classes[] = 'group-create';
        $bp_classes[] = bp_get_groups_current_create_step();
    }
    if (bp_is_group_home()) {
        $bp_classes[] = 'group-home';
    }
    if (bp_is_single_activity()) {
        $bp_classes[] = 'activity-permalink';
    }
    /** Registration ******************************************************/
    if (bp_is_register_page()) {
        $bp_classes[] = 'registration';
    }
    if (bp_is_activation_page()) {
        $bp_classes[] = 'activation';
    }
    /** Current Component & Action ****************************************/
    if (!bp_is_blog_page()) {
        $bp_classes[] = bp_current_component();
        $bp_classes[] = bp_current_action();
    }
    /** Clean up ***********************************************************/
    // Add BuddyPress class if we are within a BuddyPress page
    if (!bp_is_blog_page()) {
        $bp_classes[] = 'buddypress';
    }
    // Merge WP classes with BuddyPress classes and remove any duplicates
    $classes = array_unique(array_merge((array) $bp_classes, (array) $wp_classes));
    return apply_filters('bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes);
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:101,代码来源:bp-core-template.php

示例9: array

if (!bp_is_item_admin()) {
    die;
}
?>

<div class="item-list-tabs no-ajax" id="subnav" role="tablist">

	<ul class="nav nav-pills" id="nav-sub">
        <?php 
/* 
 * Note that for the including of templates, we follow that the files
 * so make sure that file naming matches the keys
 */
$admin_menu = array('edit-details' => 'Details', 'group-settings' => 'Settings', 'group-avatar' => 'Photo', 'manage-members' => 'Members', 'membership-requests' => 'Requests', 'delete-group' => 'Delete');
$current_tab = bp_get_group_current_admin_tab();
$group = groups_get_current_group();
foreach ($admin_menu as $url_key => $name) {
    if ($group->status !== 'private' && $url_key == 'membership-requests') {
        continue;
    }
    $url = trailingslashit(bp_get_group_permalink($group)) . 'admin/' . $url_key;
    $tpl = $current_tab == $url_key ? "<li class=\"active\">" : "<li>";
    $tpl .= "<a href=\"%s\">%s</a>";
    $tpl .= "</li>";
    printf($tpl, $url, $name);
}
?>
	</ul>

</div><!-- .item-list-tabs -->
开发者ID:par-orillonsoft,项目名称:myfossil-theme,代码行数:30,代码来源:admin.php


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