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


PHP bp_loggedin_user_domain函数代码示例

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


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

示例1: profile_tab_gifts

 public function profile_tab_gifts()
 {
     global $bp;
     bp_core_new_nav_item(array('parent_url' => bp_loggedin_user_domain() . '/gifts/', 'parent_slug' => $bp->profile->slug, 'default_subnav_slug' => 'send_gift', 'show_for_displayed_user' => false, 'name' => 'Gifts', 'slug' => 'gifts', 'screen_function' => array($this, 'send_gift_posts'), 'position' => 40));
     bp_core_new_subnav_item(array('name' => 'Send Gift', 'slug' => 'send_gift', 'show_for_displayed_user' => false, 'parent_url' => bp_loggedin_user_domain() . '/gifts/', 'parent_slug' => $bp->bp_nav['gifts']['slug'], 'position' => 10, 'screen_function' => array($this, 'send_gift_posts')));
     bp_core_new_subnav_item(array('name' => 'Received Gift', 'slug' => 'received_gift', 'parent_url' => bp_loggedin_user_domain() . '/gifts/', 'parent_slug' => $bp->bp_nav['gifts']['slug'], 'position' => 10, 'screen_function' => array($this, 'received_gifts_posts')));
 }
开发者ID:aiyazkhorajia,项目名称:buddypress-gift-addon,代码行数:7,代码来源:buddypress-gift-addon.php

示例2: bp_members_admin_bar_my_account_menu

/**
 * Add the "My Account" menu and all submenus.
 *
 * @since 1.6.0
 *
 * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support
 */
function bp_members_admin_bar_my_account_menu()
{
    global $wp_admin_bar;
    // Bail if this is an ajax request
    if (defined('DOING_AJAX')) {
        return;
    }
    // Logged in user
    if (is_user_logged_in()) {
        $bp = buddypress();
        // Stored in the global so we can add menus easily later on
        $bp->my_account_menu_id = 'my-account-buddypress';
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'group' => true, 'title' => __('Edit My Profile', 'buddypress'), 'href' => bp_loggedin_user_domain(), 'meta' => array('class' => 'ab-sub-secondary')));
        // Show login and sign-up links
    } elseif (!empty($wp_admin_bar)) {
        add_filter('show_admin_bar', '__return_true');
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => 'bp-login', 'title' => __('Log in', 'buddypress'), 'href' => wp_login_url(bp_get_requested_url())));
        // Sign up
        if (bp_get_signup_allowed()) {
            $wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
        }
    }
}
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:32,代码来源:bp-members-adminbar.php

示例3: bp_reshare_notajaxed_feed_url

function bp_reshare_notajaxed_feed_url($feed_url)
{
    if ($_COOKIE['bp-activity-scope'] == 'reshares') {
        $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/reshares/feed/';
    }
    return $feed_url;
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:7,代码来源:bp-reshare-filters.php

示例4: bp_content_setup_nav

function bp_content_setup_nav()
{
    global $bp;
    bp_core_new_nav_item(array('name' => __('My Posts', 'buddypress'), 'slug' => 'my-posts', 'screen_function' => 'my_posts_screen_link', 'position' => 40, 'default_subnav_slug' => 'my-posts-subnav'));
    bp_core_new_subnav_item(array('name' => __('', 'buddypress'), 'slug' => 'my-posts', 'parent_url' => trailingslashit(bp_loggedin_user_domain() . 'main-tab'), 'parent_slug' => 'my-posts', 'screen_function' => 'my_posts_screen_link', 'position' => 10));
    do_action('bp_content_setup_nav');
}
开发者ID:hardikdashora,项目名称:posts-on-buddpress-profiles,代码行数:7,代码来源:profiles.php

示例5: friends_screen_requests

/**
 * Catch and process the Requests page.
 */
function friends_screen_requests()
{
    if (bp_is_action_variable('accept', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_accept_friendship');
        if (friends_accept_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship accepted', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be accepted', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    } elseif (bp_is_action_variable('reject', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_reject_friendship');
        if (friends_reject_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship rejected', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be rejected', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    } elseif (bp_is_action_variable('cancel', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_withdraw_friendship');
        if (friends_withdraw_friendship(bp_loggedin_user_id(), bp_action_variable(1))) {
            bp_core_add_message(__('Friendship request withdrawn', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship request could not be withdrawn', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    }
    do_action('friends_screen_requests');
    bp_core_load_template(apply_filters('friends_template_requests', 'members/single/home'));
}
开发者ID:eresyyl,项目名称:mk,代码行数:36,代码来源:bp-friends-screens.php

示例6: friends_format_notifications

/**
 * Format the BuddyBar/Toolbar notifications for the Friends component
 *
 * @package BuddyPress
 *
 * @param string $action The kind of notification being rendered
 * @param int $item_id The primary item id
 * @param int $secondary_item_id The secondary item id
 * @param int $total_items The total number of messaging-related notifications waiting for the user
 * @param string $format 'string' for BuddyBar-compatible notifications; 'array' for WP Toolbar
 */
function friends_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string')
{
    switch ($action) {
        case 'friendship_accepted':
            $link = trailingslashit(bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends');
            // Set up the string and the filter
            if ((int) $total_items > 1) {
                $text = sprintf(__('%d friends accepted your friendship requests', 'buddypress'), (int) $total_items);
                $filter = 'bp_friends_multiple_friendship_accepted_notification';
            } else {
                $text = sprintf(__('%s accepted your friendship request', 'buddypress'), bp_core_get_user_displayname($item_id));
                $filter = 'bp_friends_single_friendship_accepted_notification';
            }
            break;
        case 'friendship_request':
            $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/?new';
            // Set up the string and the filter
            if ((int) $total_items > 1) {
                $text = sprintf(__('You have %d pending friendship requests', 'buddypress'), (int) $total_items);
                $filter = 'bp_friends_multiple_friendship_request_notification';
            } else {
                $text = sprintf(__('You have a friendship request from %s', 'buddypress'), bp_core_get_user_displayname($item_id));
                $filter = 'bp_friends_single_friendship_request_notification';
            }
            break;
    }
    // Return either an HTML link or an array, depending on the requested format
    if ('string' == $format) {
        $return = apply_filters($filter, '<a href="' . $link . '">' . $text . '</a>', (int) $total_items);
    } else {
        $return = apply_filters($filter, array('link' => $link, 'text' => $text), (int) $total_items);
    }
    do_action('friends_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $return);
    return $return;
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:46,代码来源:bp-friends-activity.php

示例7: bp_follow_format_notifications

/**
 * Format on screen notifications into something readable by users.
 *
 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
 */
function bp_follow_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string')
{
    global $bp;
    do_action('bp_follow_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $format);
    switch ($action) {
        case 'new_follow':
            $link = $text = false;
            if (1 == $total_items) {
                $text = sprintf(__('%s is now following you', 'bp-follow'), bp_core_get_user_displayname($item_id));
                $link = bp_core_get_user_domain($item_id) . '?bpf_read';
            } else {
                $text = sprintf(__('%d more users are now following you', 'bp-follow'), $total_items);
                if (bp_is_active('notifications')) {
                    $link = bp_get_notifications_permalink();
                } else {
                    $link = bp_loggedin_user_domain() . $bp->follow->followers->slug . '/?new';
                }
            }
            break;
        default:
            $link = apply_filters('bp_follow_extend_notification_link', false, $action, $item_id, $secondary_item_id, $total_items);
            $text = apply_filters('bp_follow_extend_notification_text', false, $action, $item_id, $secondary_item_id, $total_items);
            break;
    }
    if (!$link || !$text) {
        return false;
    }
    if ('string' == $format) {
        return apply_filters('bp_follow_new_followers_notification', '<a href="' . $link . '">' . $text . '</a>', $total_items, $link, $text, $item_id, $secondary_item_id);
    } else {
        $array = array('text' => $text, 'link' => $link);
        return apply_filters('bp_follow_new_followers_return_notification', $array, $item_id, $secondary_item_id, $total_items);
    }
}
开发者ID:vilmark,项目名称:vilmark_main,代码行数:39,代码来源:bp-follow-notifications.php

示例8: friends_screen_requests

function friends_screen_requests()
{
    if (bp_is_action_variable('accept', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_accept_friendship');
        if (friends_accept_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship accepted', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be accepted', 'buddypress'), 'error');
        }
        bp_core_redirect(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action());
    } elseif (bp_is_action_variable('reject', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_reject_friendship');
        if (friends_reject_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship rejected', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be rejected', 'buddypress'), 'error');
        }
        bp_core_redirect(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action());
    }
    do_action('friends_screen_requests');
    if (isset($_GET['new'])) {
        bp_core_delete_notifications_by_type(bp_loggedin_user_id(), 'friends', 'friendship_request');
    }
    bp_core_load_template(apply_filters('friends_template_requests', 'members/single/home'));
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:27,代码来源:bp-friends-screens.php

示例9: mme_nav_menu_profile_links

 function mme_nav_menu_profile_links($menu, $args)
 {
     if (is_user_logged_in() && $args->theme_location == 'member') {
         $profilelink = '<li><a href="' . bp_loggedin_user_domain('/') . '">' . __('Mein Profil', 'hr-beisl') . '</a></li>';
         $menu = $profilelink . $menu;
     }
     return $menu;
 }
开发者ID:abisz,项目名称:HR-Beisl-Theme,代码行数:8,代码来源:functions.php

示例10: add_dashboard_in_menu

 function add_dashboard_in_menu($menu)
 {
     $dash_menu['dashboard'] = array('icon' => 'icon-meter', 'label' => __('Dashboard', 'wplms-dashboard'), 'link' => bp_loggedin_user_domain() . WPLMS_DASHBOARD_SLUG);
     foreach ($menu as $key => $item) {
         $dash_menu[$key] = $item;
     }
     return $dash_menu;
 }
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:8,代码来源:dashboard.php

示例11: setup_nav

 /**
  * Set up navigation
  *
  * @since 1.3
  */
 function setup_nav($main_nav = array(), $sub_nav = array())
 {
     // Add 'Example' to the main navigation
     $main_nav = array('name' => __('Projects', 'collabpress'), 'slug' => $this->slug, 'position' => 44, 'screen_function' => array($this, 'template_loader'), 'default_subnav_slug' => 'tasks', 'show_for_displayed_user' => array($this, 'show_tab_for_current_user'));
     $projects_link = trailingslashit(bp_loggedin_user_domain() . $this->slug);
     // Add a few subnav items under the main Example tab
     $sub_nav[] = array('name' => bp_is_my_profile() ? __('My Tasks', 'collabpress') : sprintf(__('%s&#8217s Tasks', 'collabpress'), bp_get_user_firstname()), 'slug' => 'tasks', 'parent_url' => $projects_link, 'parent_slug' => $this->slug, 'screen_function' => array($this, 'template_loader'), 'position' => 10);
     parent::setup_nav($main_nav, $sub_nav);
 }
开发者ID:clarkewd,项目名称:CollabPress,代码行数:14,代码来源:cp-bp.php

示例12: setup_nav

 public function setup_nav($main = array(), $sub = array())
 {
     $bp = buddypress();
     $component = 'members';
     $component_id = mpp_get_current_component_id();
     if (!mpp_is_enabled($component, $component_id)) {
         //allow to disable user galleries in case they don't want it
         return false;
     }
     $view_helper = MPP_Gallery_Screens::get_instance();
     // Add 'Gallery' to the user's main navigation
     $main_nav = array('name' => sprintf(__('Gallery <span>%d</span>', 'mediapress'), mpp_get_total_gallery_for_user()), 'slug' => $this->slug, 'position' => 86, 'screen_function' => array($view_helper, 'user_galleries'), 'default_subnav_slug' => 'my-galleries', 'item_css_id' => $this->id);
     if (bp_is_user()) {
         $user_domain = bp_displayed_user_domain();
     } else {
         $user_domain = bp_loggedin_user_domain();
     }
     $gallery_link = trailingslashit($user_domain . $this->slug);
     //with a trailing slash
     // Add the My Gallery nav item
     $sub_nav[] = array('name' => __('My Gallery', 'mediapress'), 'slug' => 'my-galleries', 'parent_url' => $gallery_link, 'parent_slug' => $this->slug, 'screen_function' => array($view_helper, 'my_galleries'), 'position' => 10, 'item_css_id' => 'gallery-my-gallery');
     if (mpp_user_can_create_gallery($component, get_current_user_id())) {
         // Add the Create gallery link to gallery nav
         $sub_nav[] = array('name' => __('Create a Gallery', 'mediapress'), 'slug' => 'create', 'parent_url' => $gallery_link, 'parent_slug' => $this->slug, 'screen_function' => array($view_helper, 'my_galleries'), 'user_has_access' => bp_is_my_profile(), 'position' => 20);
     }
     if (mpp_component_has_type_filters_enabled($component, $component_id)) {
         $i = 10;
         $supported_types = mpp_component_get_supported_types($component);
         foreach ($supported_types as $type) {
             if (!mpp_is_active_type($type)) {
                 continue;
             }
             $type_object = mpp_get_type_object($type);
             $sub_nav[] = array('name' => $type_object->label, 'slug' => 'type/' . $type, 'parent_url' => $gallery_link, 'parent_slug' => $this->slug, 'screen_function' => array($view_helper, 'my_galleries'), 'position' => 20 + $i);
             $i = $i + 10;
             //increment the position
         }
     }
     // Add the Upload link to gallery nav
     /*$sub_nav[] = array(
           'name'				=> __( 'Upload', 'mediapress'),
           'slug'				=> 'upload',
           'parent_url'		=> $gallery_link,
           'parent_slug'		=> $this->slug,
           'screen_function'	=> array( $view_helper, 'upload_media' ),
           'user_has_access'	=> bp_is_my_profile(),
           'position'			=> 30
       );*/
     parent::setup_nav($main_nav, $sub_nav);
     //disallow these names in various lists
     //we have yet to implement it
     $this->forbidden_names = apply_filters('mpp_forbidden_names', array('gallery', 'galleries', 'my-gallery', 'create', 'delete', 'upload', 'add', 'edit', 'admin', 'request', 'upload', 'tags', 'audio', 'video', 'photo'));
     //use this to extend the valid status
     $this->valid_status = apply_filters('mpp_valid_gallery_status', array_keys(mpp_get_active_statuses()));
     do_action('mpp_setup_nav');
     // $bp->gallery->current_gallery->user_has_access
 }
开发者ID:Kemitestech,项目名称:WordPress-Skeleton,代码行数:57,代码来源:mpp-bp-component.php

示例13: mexp_gdrive_get_user_profile_url

/**
 * Get user profile URL to add our Google Drive options.
 *
 * If BuddyPress is enabled and the BP Settings component is enabled, we'll
 * use the user settings URL.  Otherwise, we'll use the admin dashboard
 * profile link from the main site.
 *
 * @return string
 */
function mexp_gdrive_get_user_profile_url()
{
    if (function_exists('buddypress') && bp_is_active('settings')) {
        $url = trailingslashit(bp_loggedin_user_domain() . bp_get_settings_slug());
    } else {
        $url = get_admin_url($GLOBALS['current_site']->blog_id, 'profile.php');
    }
    return apply_filters('mexp_gdrive_get_user_profile_url', $url . '#gauth');
}
开发者ID:hwdsbcommons,项目名称:gdrive,代码行数:18,代码来源:functions.php

示例14: setup_settings_privacy_nav

 public function setup_settings_privacy_nav($wp_admin_nav)
 {
     // Setup the logged in user variables
     if (is_rtmedia_privacy_user_overide()) {
         $settings_link = trailingslashit(bp_loggedin_user_domain() . bp_get_settings_slug());
         // Add the "Profile" subnav item
         $wp_admin_nav[] = array('parent' => 'my-account-' . buddypress()->settings->id, 'id' => 'my-account-' . buddypress()->settings->id . '-privacy', 'title' => _x('Privacy', 'My Account Privacy sub nav', 'rtmedia'), 'href' => trailingslashit($settings_link . 'privacy'));
     }
     return $wp_admin_nav;
 }
开发者ID:saisai,项目名称:rtMedia,代码行数:10,代码来源:RTMediaNav.php

示例15: bp_links_dtheme_activity_type_tabs_setup

function bp_links_dtheme_activity_type_tabs_setup()
{
    global $bp;
    if (!bp_links_is_default_theme()) {
        return false;
    }
    if (is_user_logged_in() && bp_links_total_links_for_user(bp_loggedin_user_id())) {
        echo sprintf('<li id="activity-links"><a href="%s" title="%s">%s</a></li>', bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . bp_links_slug() . '/', __('The activity of links I created.', 'buddypress-links'), __('My Links', 'buddypress-links') . sprintf(' <span>%s</span>', bp_links_total_links_for_user(bp_loggedin_user_id())));
    }
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:10,代码来源:bp-links-dtheme.php


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