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


PHP bp_get_root_domain函数代码示例

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


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

示例1: bp_em_record_activity_booking_save

/**
 * @param boolean $result
 * @param EM_Booking $EM_Booking
 * @return boolean
 */
function bp_em_record_activity_booking_save($result, $EM_Booking)
{
    if ($result) {
        $rejected_statuses = array(0, 2, 3);
        //these statuses apply to rejected/cancelled bookings
        $user = $EM_Booking->person;
        $member_slug = function_exists('bp_get_members_root_slug') ? bp_get_members_root_slug() : BP_MEMBERS_SLUG;
        $member_link = trailingslashit(bp_get_root_domain()) . $member_slug . '/' . $user->user_login;
        $user_link = "<a href='" . $member_link . "/'>" . $user->display_name . "</a>";
        $event_link = $EM_Booking->get_event()->output('#_EVENTLINK');
        $status = $EM_Booking->booking_status;
        $EM_Event = $EM_Booking->get_event();
        if (empty($EM_Event->group_id)) {
            if ($status == 1 || !get_option('dbem_bookings_approval') && $status < 2) {
                $action = sprintf(__('%s is attending %s.', 'dbem'), $user_link, $event_link);
            } elseif (($EM_Booking->previous_status == 1 || !get_option('dbem_bookings_approval') && $EM_Booking->previous_status < 2) && in_array($status, $rejected_statuses)) {
                $action = sprintf(__('%s will not be attending %s anymore.', 'dbem'), $user_link, $event_link);
            }
        } else {
            $group = new BP_Groups_Group($EM_Event->group_id);
            $group_link = '<a href="' . bp_get_group_permalink($group) . '">' . bp_get_group_name($group) . '</a>';
            if ($status == 1 || !get_option('dbem_bookings_approval') && $status < 2) {
                $action = sprintf(__('%s is attending %s of the group %s.', 'dbem'), $user_link, $event_link, $group_link);
            } elseif (($EM_Booking->previous_status == 1 || !get_option('dbem_bookings_approval') && $EM_Booking->previous_status < 2) && in_array($status, $rejected_statuses)) {
                $action = sprintf(__('%s will not be attending %s of group %s anymore.', 'dbem'), $user_link, $event_link, $group_link);
            }
        }
        if (!empty($action)) {
            bp_em_record_activity(array('user_id' => $EM_Booking->person->ID, 'action' => $action, 'primary_link' => $EM_Event->output('#_EVENTURL'), 'type' => 'new_booking', 'item_id' => $EM_Event->event_id, 'secondary_item_id' => $EM_Booking->booking_id, 'hide_sitewide' => $EM_Event->event_private));
            //group activity
            if (!empty($EM_Event->group_id)) {
                //tis a group event
                bp_em_record_activity(array('component' => 'groups', 'item_id' => $EM_Event->group_id, 'user_id' => $EM_Booking->person->ID, 'action' => $action, 'primary_link' => $EM_Event->output('#_EVENTURL'), 'type' => 'new_booking', 'secondary_item_id' => $EM_Booking->booking_id, 'hide_sitewide' => $EM_Event->event_private));
            }
        }
    }
    return $result;
}
开发者ID:rajankz,项目名称:webspace,代码行数:43,代码来源:bp-em-activity.php

示例2: bp_get_groups_action_link

 function bp_get_groups_action_link($action = '', $query_args = '', $nonce = false)
 {
     global $bp;
     // Must be displayed user
     if (empty($bp->groups->current_group->id)) {
         return;
     }
     // Append $action to $url if there is no $type
     if (!empty($action)) {
         $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug . '/' . $action;
     } else {
         $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug;
     }
     // Add a slash at the end of our user url
     $url = trailingslashit($url);
     // Add possible query arg
     if (!empty($query_args) && is_array($query_args)) {
         $url = add_query_arg($query_args, $url);
     }
     // To nonce, or not to nonce...
     if (true === $nonce) {
         $url = wp_nonce_url($url);
     } elseif (is_string($nonce)) {
         $url = wp_nonce_url($url, $nonce);
     }
     // Return the url, if there is one
     if (!empty($url)) {
         return $url;
     }
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:30,代码来源:1.5-abstraction.php

示例3: custom_media_nav_tab

 /**
  * Load Custom tabs on BuddyPress
  *
  * @global object $bp global BuddyPress object
  */
 function custom_media_nav_tab()
 {
     global $bp;
     if (!function_exists("bp_core_new_nav_item")) {
         return;
     }
     if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
         return;
     }
     global $rtmedia;
     if (function_exists("bp_is_group") && !bp_is_group()) {
         if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
             $profile_counts = $this->actual_counts($bp->displayed_user->id);
         }
         $tab_position = apply_filters('rtmedia_media_tab_position', 99);
         if ($rtmedia->options["buddypress_enableOnProfile"] != 0) {
             bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
         }
     }
     if (bp_is_group() && $rtmedia->options["buddypress_enableOnGroup"] != 0) {
         global $bp;
         $media_enabled = true;
         //filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
         $media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
         // check if current user can view this group
         $current_group = groups_get_current_group();
         $is_visible_to_current_user = $current_group->is_visible;
         if ($media_enabled && $is_visible_to_current_user) {
             $group_counts = $this->actual_counts($bp->groups->current_group->id, "group");
             $bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . RTMEDIA_MEDIA_SLUG, 'slug' => RTMEDIA_MEDIA_SLUG, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
         }
     }
 }
开发者ID:saisai,项目名称:rtMedia,代码行数:38,代码来源:RTMediaNav.php

示例4: validate_url_to_item_id

 /**
  * Validates the URL to determine if the activity item is valid.
  *
  * @since 2.6.0
  *
  * @param  string   $url The URL to check.
  * @return int|bool Activity ID on success; boolean false on failure.
  */
 protected function validate_url_to_item_id($url)
 {
     if (bp_core_enable_root_profiles()) {
         $domain = bp_get_root_domain();
     } else {
         $domain = bp_get_members_directory_permalink();
     }
     // Check the URL to see if this is a single activity URL.
     if (0 !== strpos($url, $domain)) {
         return false;
     }
     // Check for activity slug.
     if (false === strpos($url, '/' . bp_get_activity_slug() . '/')) {
         return false;
     }
     // Do more checks.
     $url = trim(untrailingslashit($url));
     // Grab the activity ID.
     $activity_id = (int) substr($url, strrpos($url, '/') + 1);
     if (!empty($activity_id)) {
         // Check if activity item still exists.
         $activity = new BP_Activity_Activity($activity_id);
         // Okay, we're good to go!
         if (!empty($activity->component) && 0 === (int) $activity->is_spam) {
             return $activity_id;
         }
     }
     return false;
 }
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:37,代码来源:class-bp-activity-oembed-extension.php

示例5: add_cover

 function add_cover()
 {
     if (!is_user_logged_in()) {
         return;
     }
     $user_ID = get_current_user_id();
     $output = '';
     if (groups_is_user_mod($user_ID, $this->group_id) || groups_is_user_admin($user_ID, $this->group_id)) {
         if ($this->get_cover()) {
             $message = __("Change Cover", 'bpcp');
         } else {
             $message = __("Add Cover", 'bpcp');
         }
         $group = groups_get_group(array('group_id' => $this->group_id));
         $group_permalink = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/');
         $output .= '<div class="profile-cover-action">';
         $output .= '<a href="' . trailingslashit($group_permalink . 'admin') . $this->slug . '" class="button">' . $message . '</a>';
         $output .= '</div>';
     }
     $default_cover = bp_get_option('bpcp-group-default');
     if ($this->get_cover() || $default_cover) {
         $output .= '<div class="profile-cover-inner"></div>';
     }
     echo $output;
 }
开发者ID:EfncoPlugins,项目名称:buddypress-cover-photo,代码行数:25,代码来源:group-cover.php

示例6: bp_forums_directory_forums_setup

function bp_forums_directory_forums_setup()
{
    global $bp;
    if (bp_is_forums_component() && (!bp_current_action() || 'tag' == bp_current_action() && bp_action_variables()) && !bp_current_item()) {
        if (!bp_forums_has_directory()) {
            return false;
        }
        if (!bp_forums_is_installed_correctly()) {
            bp_core_add_message(__('The forums component has not been set up yet.', 'buddypress'), 'error');
            bp_core_redirect(bp_get_root_domain());
        }
        bp_update_is_directory(true, 'forums');
        do_action('bbpress_init');
        // Check to see if the user has posted a new topic from the forums page.
        if (isset($_POST['submit_topic']) && bp_is_active('forums')) {
            check_admin_referer('bp_forums_new_topic');
            $bp->groups->current_group = groups_get_group(array('group_id' => $_POST['topic_group_id']));
            if (!empty($bp->groups->current_group->id)) {
                // Auto join this user if they are not yet a member of this group
                if (!is_super_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member($bp->loggedin_user->id, $bp->groups->current_group->id)) {
                    groups_join_group($bp->groups->current_group->id);
                }
                $error_message = '';
                $forum_id = groups_get_groupmeta($bp->groups->current_group->id, 'forum_id');
                if (!empty($forum_id)) {
                    if (empty($_POST['topic_title'])) {
                        $error_message = __('Please provide a title for your forum topic.', 'buddypress');
                    } else {
                        if (empty($_POST['topic_text'])) {
                            $error_message = __('Forum posts cannot be empty. Please enter some text.', 'buddypress');
                        }
                    }
                    if ($error_message) {
                        bp_core_add_message($error_message, 'error');
                        $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
                    } else {
                        if (!($topic = groups_new_group_forum_topic($_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id))) {
                            bp_core_add_message(__('There was an error when creating the topic', 'buddypress'), 'error');
                            $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
                        } else {
                            bp_core_add_message(__('The topic was created successfully', 'buddypress'));
                            $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum/topic/' . $topic->topic_slug . '/';
                        }
                    }
                    bp_core_redirect($redirect);
                } else {
                    bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
                    bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
                }
            } else {
                bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
                bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
            }
        }
        do_action('bp_forums_directory_forums_setup');
        bp_core_load_template(apply_filters('bp_forums_template_directory_forums_setup', 'forums/index'));
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:58,代码来源:bp-forums-screens.php

示例7: bp_reshare_replace_activity_delete_link

function bp_reshare_replace_activity_delete_link($link)
{
    // if activity type is a reshare, then we replace the delete link behavior
    if (bp_get_activity_type() == 'reshare_update') {
        $class = 'delete-reshare';
        $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?delete_reshare=' . bp_get_activity_id(), '_reshare_delete');
        $link = '<a href="' . $action_url . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __('Delete', 'bp-reshare') . '</a>';
    }
    return apply_filters('bp_reshare_replace_activity_delete_link', $link);
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:10,代码来源:bp-reshare-filters.php

示例8: test_member_directory_when_nested_under_wp_page

 /**
  * @ticket BP6475
  */
 public function test_member_directory_when_nested_under_wp_page()
 {
     $p = $this->factory->post->create(array('post_type' => 'page', 'post_name' => 'foo'));
     $members_page = get_page_by_path('members');
     wp_update_post(array('ID' => $members_page->ID, 'post_parent' => $p));
     $members_page_permalink = bp_get_root_domain() . '/foo/members/';
     $this->go_to($members_page_permalink);
     $this->assertTrue(bp_is_members_component());
     $this->assertEquals('', bp_current_action());
 }
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:13,代码来源:members.php

示例9: bp_blogs_creation_location

/**
 * Ensure that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup.
 *
 * @since BuddyPress (1.6.0)
 *
 * @uses apply_filters() Filter 'bp_blogs_creation_location' to alter the
 *       returned value.
 *
 * @param string $url The original URL (points to wp-signup.php by default).
 * @return string The new URL.
 */
function bp_blogs_creation_location($url)
{
    /**
     * Filters the 'Create a new site' link URL.
     *
     * @since BuddyPress (1.6.0)
     *
     * @param string $value URL for the 'Create a new site' signup page.
     */
    return apply_filters('bp_blogs_creation_location', trailingslashit(bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url));
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:22,代码来源:bp-blogs-filters.php

示例10: cac_catch_group_doc_request

/**
 * 
 * @return type
 * @since 0.5
 * @version 1.2.2
 * v2, 10/5/2013
 */
function cac_catch_group_doc_request()
{
    $error = false;
    if (empty($_GET['get_group_doc'])) {
        return;
    }
    $doc_id = $_GET['get_group_doc'];
    // Check to see whether the current user has access to the doc in question
    $file_deets = explode('/', $doc_id);
    $group_id = $file_deets[0];
    $group = new BP_Groups_Group($group_id);
    $doc_name = $file_deets[1];
    if (empty($group->id)) {
        $error = array('message' => __('That group does not exist.', 'bp-group-documents'), 'redirect' => bp_get_root_domain());
    } else {
        if ($group->status != 'public') {
            // If the group is not public,
            if (!is_super_admin()) {
                //then the user must be logged in and
                // a member of the group to download the document
                if (!is_user_logged_in() || !groups_is_user_member(bp_loggedin_user_id(), $group_id)) {
                    $error = array('message' => sprintf(__('You must be a logged-in member of the group %s to access this document. If you are a member of the group, please log into the site and try again.', 'bp-group-documents'), $group->name), 'redirect' => bp_get_group_permalink($group));
                }
            }
        }
        // If we have gotten this far without an error, then the download can go through
        if (!$error) {
            $document = new BP_Group_Documents();
            $document->populate_by_file($doc_name);
            $doc_path = $document->get_path();
            clearstatcache();
            if (file_exists($doc_path)) {
                $mime_type = mime_content_type($doc_path);
                $doc_size = filesize($doc_path);
                header("Cache-Control: public, must-revalidate, post-check=0, pre-check=0");
                header("Pragma: hack");
                header("Content-Type: {$mime_type}; name='" . $file_deets[1] . "'");
                header("Content-Length: " . $doc_size);
                header('Content-Disposition: inline; filename="' . $file_deets[1] . '"');
                header("Content-Transfer-Encoding: binary");
                ob_clean();
                flush();
                readfile($doc_path);
                die;
            } else {
                // File does not exist
                $error = array('message' => _e('The file could not be found.', 'bp-group-documents'), 'redirect' => bp_get_group_permalink($group) . 'documents');
            }
        }
    }
    // If we have gotten this far, there was an error. Add a message and redirect
    bp_core_add_message($error['message'], 'error');
    bp_core_redirect($error['redirect']);
}
开发者ID:lilarock3rs,项目名称:bp-group-documents,代码行数:61,代码来源:filters.php

示例11: bp_friend_suggest_hide_link

function bp_friend_suggest_hide_link($possible_friend)
{
    $url = bp_get_root_domain() . "/remove-friend-suggestion/?suggest_id=" . $possible_friend . "&_wpnonce=" . wp_create_nonce('friend-suggestion-remove-' . $possible_friend);
    ?>
<span class="remove-friend-suggestion"><a href="<?php 
    echo $url;
    ?>
" title="<?php 
    _e('Hide this suggestion', 'bp-friend-suggest');
    ?>
">x</a></span>
<?php 
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:13,代码来源:bp-friend-suggest-functions.php

示例12: custom_media_nav_tab

 /**
  * Load Custom tabs on BuddyPress
  *
  * @global object $bp global BuddyPress object
  */
 function custom_media_nav_tab()
 {
     $bp = buddypress();
     if (!function_exists('bp_core_new_nav_item')) {
         return;
     }
     if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
         return;
     }
     global $rtmedia;
     if (function_exists('bp_is_group') && !bp_is_group()) {
         if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
             $profile_counts = $this->actual_counts($bp->displayed_user->id);
         }
         $tab_position = apply_filters('rtmedia_media_tab_position', 99);
         if (0 !== intval($rtmedia->options['buddypress_enableOnProfile'])) {
             bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
         }
     }
     if (bp_is_group() && 0 !== intval($rtmedia->options['buddypress_enableOnGroup'])) {
         $media_enabled = true;
         //filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
         $media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
         // check if current user can view this group
         $current_group = groups_get_current_group();
         /**
          * remove `$current_group->is_visible` and add `bp_group_is_visible( $current_group )`
          * reason   : In Buddypress 2.7 `is_visible` return false so we can't display `media` tab on group
          * issue id	: http://git.rtcamp.com/rtmedia/rtMedia/issues/119
          */
         // $is_visible_to_current_user = $current_group->is_visible;
         $is_visible_to_current_user = bp_group_is_visible($current_group);
         if ($media_enabled && $is_visible_to_current_user) {
             $group_counts = $this->actual_counts($bp->groups->current_group->id, 'group');
             $slug = apply_filters('rtmedia_group_media_tab_slug', RTMEDIA_MEDIA_SLUG);
             if (isset($bp->version) && $bp->version > '2.5.3') {
                 /*
                  * As from BuddyPress 2.6, you can't access $bp->bp_options_nav directly.
                  * Use `bp_core_new_subnav_item` to add subnav item.
                  *
                  * Check https://buddypress.trac.wordpress.org/ticket/6534 and https://buddypress.trac.wordpress.org/changeset/10745
                  * for more details
                  */
                 bp_core_new_subnav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'parent_slug' => bp_get_current_group_slug(), 'parent_url' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/'), 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all'));
             } else {
                 $bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
             }
         }
     }
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:55,代码来源:RTMediaNav.php

示例13: bp_reshare_add_reshare_button

function bp_reshare_add_reshare_button()
{
    global $bp;
    if (!is_user_logged_in()) {
        return false;
    }
    $activity_types_resharable = bp_reshare_activity_types();
    if (!in_array(bp_get_activity_type(), $activity_types_resharable)) {
        return false;
    }
    if (bp_reshare_activity_is_hidden()) {
        return false;
    }
    if (bp_reshare_is_user_profile_reshares() && $bp->displayed_user->id != $bp->loggedin_user->id) {
        return false;
    }
    $activity_first_id = bp_get_activity_id();
    if ('reshare_update' == bp_get_activity_type()) {
        $activity_first_id = bp_get_activity_secondary_item_id();
    }
    $rs_count = bp_activity_get_meta($activity_first_id, 'reshared_count');
    $rs_count = !empty($rs_count) ? $rs_count : 0;
    if ($bp->loggedin_user->id == bp_get_activity_user_id() || bp_reshare_user_did_reshared($activity_first_id)) {
        $reshared_class = 'reshared';
    }
    $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?to_reshare=' . $activity_first_id, '_reshare_update');
    if ($_POST['scope'] == 'reshares' || bp_reshare_is_user_profile_reshares() || bp_is_activity_component() && !bp_displayed_user_id() && $_COOKIE['bp-activity-scope'] == 'reshares') {
        $extra_class = 'unshare';
        $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?delete_reshare=' . bp_get_activity_id(), '_reshare_delete');
    }
    ?>
	
	<a href="<?php 
    echo $action_url;
    ?>
" class="button bp-primary-action bp-agu-reshare" id="bp-agu-reshare-<?php 
    bp_activity_id();
    ?>
" rel="<?php 
    echo $activity_first_id;
    ?>
"><span class="bp-agu-reshare-img <?php 
    echo $reshared_class . ' ' . $extra_class;
    ?>
"></span><span class="rs-count"><?php 
    echo $rs_count;
    ?>
</span></a>
	<?php 
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:50,代码来源:bp-reshare-screens.php

示例14: bp_adminbar_blogs_menu

/**
 * Add a Sites menu to the BuddyBar.
 *
 * @since BuddyPress (1.0.0)
 *
 * @global object $bp The BuddyPress global settings object.
 *
 * @return bool|null Returns false on failure. Otherwise echoes the menu item.
 */
function bp_adminbar_blogs_menu()
{
    global $bp;
    if (!is_user_logged_in() || !bp_is_active('blogs')) {
        return false;
    }
    if (!is_multisite()) {
        return false;
    }
    $blogs = wp_cache_get('bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp');
    if (empty($blogs)) {
        $blogs = bp_blogs_get_blogs_for_user(bp_loggedin_user_id(), true);
        wp_cache_set('bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', $blogs, 'bp');
    }
    $counter = 0;
    if (is_array($blogs['blogs']) && (int) $blogs['count']) {
        echo '<li id="bp-adminbar-blogs-menu"><a href="' . trailingslashit(bp_loggedin_user_domain() . bp_get_blogs_slug()) . '">';
        _e('My Sites', 'buddypress');
        echo '</a>';
        echo '<ul>';
        foreach ((array) $blogs['blogs'] as $blog) {
            $alt = 0 == $counter % 2 ? ' class="alt"' : '';
            $site_url = esc_attr($blog->siteurl);
            echo '<li' . $alt . '>';
            echo '<a href="' . $site_url . '">' . esc_html($blog->name) . '</a>';
            echo '<ul>';
            echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __('Dashboard', 'buddypress') . '</a></li>';
            echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __('New Post', 'buddypress') . '</a></li>';
            echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __('Manage Posts', 'buddypress') . '</a></li>';
            echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __('Manage Comments', 'buddypress') . '</a></li>';
            echo '</ul>';
            do_action('bp_adminbar_blog_items', $blog);
            echo '</li>';
            $counter++;
        }
        $alt = 0 == $counter % 2 ? ' class="alt"' : '';
        if (bp_blog_signup_enabled()) {
            echo '<li' . $alt . '>';
            echo '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __('Create a Site!', 'buddypress') . '</a>';
            echo '</li>';
        }
        echo '</ul>';
        echo '</li>';
    }
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:54,代码来源:bp-blogs-buddybar.php

示例15: bp_admin_bar_root_site

/**
 * Add a menu for the root site of this BuddyPress network
 *
 * @global type $nxt_admin_bar
 * @return If in ajax
 */
function bp_admin_bar_root_site()
{
    global $nxt_admin_bar;
    // Create the root blog menu
    $nxt_admin_bar->add_menu(array('id' => 'bp-root-blog', 'title' => get_blog_option(bp_get_root_blog_id(), 'blogname'), 'href' => bp_get_root_domain()));
    // Logged in user
    if (is_user_logged_in()) {
        // Dashboard links
        if (is_super_admin()) {
            // Add site admin link
            $nxt_admin_bar->add_menu(array('id' => 'dashboard', 'parent' => 'bp-root-blog', 'title' => __('Admin Dashboard', 'buddypress'), 'href' => get_admin_url(bp_get_root_blog_id())));
            // Add network admin link
            if (is_multisite()) {
                // Link to the network admin dashboard
                $nxt_admin_bar->add_menu(array('id' => 'network-dashboard', 'parent' => 'bp-root-blog', 'title' => __('Network Dashboard', 'buddypress'), 'href' => network_admin_url()));
            }
        }
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:25,代码来源:bp-core-adminbar.php


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