本文整理汇总了PHP中bp_get_loggedin_user_fullname函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_loggedin_user_fullname函数的具体用法?PHP bp_get_loggedin_user_fullname怎么用?PHP bp_get_loggedin_user_fullname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_loggedin_user_fullname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_members_admin_bar_my_account_menu
/**
* Add the "My Account" menu and all submenus.
*
* @since BuddyPress (r4151)
*/
function bp_members_admin_bar_my_account_menu()
{
global $bp, $wp_admin_bar;
// Bail if this is an ajax request
if (defined('DOING_AJAX')) {
return;
}
// Logged in user
if (is_user_logged_in()) {
// User avatar
$avatar = bp_core_fetch_avatar(array('item_id' => $bp->loggedin_user->id, 'email' => $bp->loggedin_user->userdata->user_email, 'width' => 16, 'height' => 16));
// Unique ID for the 'My Account' menu
$bp->my_account_menu_id = !empty($avatar) ? 'my-account-with-avatar' : 'my-account';
// Create the main 'My Account' menu
$wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'title' => $avatar . bp_get_loggedin_user_fullname(), 'href' => $bp->loggedin_user->domain));
// 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()));
// Sign up
if (bp_get_signup_allowed()) {
$wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
}
}
}
示例2: kleo_menu_user_avatar
/**
* Render user avatar menu item
*
* @param string $item_output
* @param array $item
* @param integer $depth
* @param object $args
* @return string
*/
function kleo_menu_user_avatar($item_output, $item, $depth, $args)
{
$output = '';
if (is_user_logged_in()) {
$url = bp_loggedin_user_domain();
$attr_title = strip_tags($item->attr_title);
$output .= '<a title="' . bp_get_loggedin_user_fullname() . '" class="kleo-bp-user-avatar' . ($args->has_children && in_array($depth, array(0, 1)) ? ' js-activated' : '') . '" href="' . $url . '" title="' . $attr_title . '">' . '<img src="' . bp_get_loggedin_user_avatar(array('width' => 25, 'height' => 25, 'html' => false)) . '" class="kleo-rounded" alt="">' . ($item->attr_title != '' ? ' ' . $item->attr_title : '');
$output .= $args->has_children && in_array($depth, array(0, 1)) ? ' <span class="caret"></span></a>' : '</a>';
return $output;
} elseif ($args->has_children && in_array($depth, array(0, 1))) {
return $item_output;
} else {
return '';
}
}
示例3: bp_members_admin_bar_my_account_menu
/**
* Add the "My Account" menu and all submenus.
*
* @since BuddyPress (r4151)
* @todo Deprecate WP 3.2 admin bar compatibility when we drop 3.2 support
*/
function bp_members_admin_bar_my_account_menu()
{
global $bp, $wp_admin_bar, $wp_version;
// Bail if this is an ajax request
if (defined('DOING_AJAX')) {
return;
}
// Logged in user
if (is_user_logged_in()) {
// User avatar
$avatar = bp_core_fetch_avatar(array('item_id' => bp_loggedin_user_id(), 'email' => $bp->loggedin_user->userdata->user_email, 'width' => 16, 'height' => 16));
// Some admin bar setup in WP 3.2 differs from WP 3.3+.
// Backward-compatibility will be deprecated at some point.
if (version_compare((double) $wp_version, '3.3', '>=')) {
// Stored in the global so we can add menus easily later on
$bp->my_account_menu_id = 'my-account-buddypress';
$title = bp_get_loggedin_user_fullname() . $avatar;
$class = 'opposite';
if (!empty($avatar)) {
$class .= ' with-avatar';
}
$meta = array('class' => $class);
} else {
$bp->my_account_menu_id = !empty($avatar) ? 'my-account-with-avatar' : 'my-account';
$title = $avatar . bp_get_loggedin_user_fullname();
$meta = array();
}
// Create the main 'My Account' menu
$wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'title' => $title, 'href' => $bp->loggedin_user->domain, 'meta' => $meta));
// 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()));
// Sign up
if (bp_get_signup_allowed()) {
$wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
}
}
}
示例4: do_action
do_action('bp_user_deposits_options_nav');
?>
</ul>
</div>
</div><!-- #item-nav -->
<div id="item-body" role="main">
<?php
do_action('bp_before_user_deposits_body');
?>
<?php
$displayed_user_fullname = bp_get_displayed_user_fullname();
if (!empty($displayed_user_fullname) && $displayed_user_fullname == bp_get_loggedin_user_fullname() && is_user_logged_in()) {
echo '<a href="/deposits/item/new/" class="bp-deposits-deposit button" title="Deposit an Item">Deposit an Item</a><p />';
}
?>
<div class="item-list-tabs" id="subnav">
<ul>
<li class="current selected" id="deposits-personal"><a href="#"></a></li>
<li id="deposits-order-select" class="last filter">
<label for="deposits-order-by"><?php
_e('Order By:', 'humcore_domain');
?>
</label>
<select id="deposits-order-by">
示例5: bp_loggedin_user_domain
?>
<div id="mpp-whats-new-avatar">
<a href="<?php
echo bp_loggedin_user_domain();
?>
">
<?php
bp_loggedin_user_avatar('width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height());
?>
</a>
</div>
<p class="activity-greeting">
<?php
printf(__("Want to say Something, %s?", 'mediapress'), bp_get_user_firstname(bp_get_loggedin_user_fullname()));
?>
</p>
<div id="mpp-whats-new-content">
<div id="mpp-whats-new-textarea">
<textarea name="mpp-whats-new" id="mpp-whats-new" cols="50" rows="3"><?php
if (isset($_GET['r'])) {
?>
@<?php
echo esc_textarea($_GET['r']);
?>
<?php
}
?>
示例6: bp_loggedin_user_domain
<div id="whats-new-avatar">
<a href="<?php
echo bp_loggedin_user_domain();
?>
">
<?php
bp_loggedin_user_avatar('width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height());
?>
</a>
</div>
<p class="activity-greeting"><?php
if (bp_is_group()) {
printf(__("What's new in %s, %s?", 'wonderflux'), bp_get_group_name(), bp_get_user_firstname(bp_get_loggedin_user_fullname()));
} else {
printf(__("What's new, %s?", 'wonderflux'), bp_get_user_firstname(bp_get_loggedin_user_fullname()));
}
?>
</p>
<div id="whats-new-content">
<div id="whats-new-textarea">
<label for="whats-new" class="bp-screen-reader-text"><?php
_e('Post what\'s new', 'wonderflux');
?>
</label>
<textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"
<?php
if (bp_is_group()) {
?>
data-suggestions-group-id="<?php
示例7: save_messages
public function save_messages()
{
$new_message = new BP_Chat_Message();
$new_message->message = esc_html($_POST['message']);
$new_message->channel_id = absint($_POST['channel_id']);
$new_message->sender_id = get_current_user_id();
$new_message->save();
// open this channel, we don't care anymore who are subscribed to this channel
bpchat_update_all_channel_user($new_message->channel_id, 'open');
//status of the channel
//update senders last activity time
bpchat_update_last_active($new_message->sender_id);
//update last active time for sender
echo json_encode(array('name' => bp_get_loggedin_user_fullname(), 'id' => $new_message->id));
exit(0);
}
示例8: bp_follow_get_add_follow_button
/**
* Returns a follow / unfollow button for a given user depending on the follower status.
*
* Checks to see if the follower is already following the leader. If is following, returns
* "Stop following" button; if not following, returns "Follow" button.
*
* @param array $args {
* Array of arguments.
* @type int $leader_id The user ID of the person we want to follow.
* @type int $follower_id The user ID initiating the follow request.
* @type string $link_text The anchor text for the link.
* @type string $link_title The title attribute for the link.
* @type string $wrapper_class CSS class for the wrapper container.
* @type string $link_class CSS class for the link.
* @type string $wrapper The element for the wrapper container. Defaults to 'div'.
* }
* @return mixed String of the button on success. Boolean false on failure.
* @uses bp_get_button() Renders a button using the BP Button API
* @author r-a-y
* @since 1.1
*/
function bp_follow_get_add_follow_button($args = '')
{
global $bp, $members_template;
$r = wp_parse_args($args, array('leader_id' => bp_displayed_user_id(), 'follower_id' => bp_loggedin_user_id(), 'link_text' => '', 'link_title' => '', 'wrapper_class' => '', 'link_class' => '', 'wrapper' => 'div'));
if (!$r['leader_id'] || !$r['follower_id']) {
return false;
}
// if we're checking during a members loop, then follow status is already
// queried via bp_follow_inject_member_follow_status()
if (!empty($members_template->in_the_loop) && $r['follower_id'] == bp_loggedin_user_id() && $r['leader_id'] == bp_get_member_user_id()) {
$is_following = $members_template->member->is_following;
// else we manually query the follow status
} else {
$is_following = bp_follow_is_following(array('leader_id' => $r['leader_id'], 'follower_id' => $r['follower_id']));
}
// if the logged-in user is the leader, use already-queried variables
if (bp_loggedin_user_id() && $r['leader_id'] == bp_loggedin_user_id()) {
$leader_domain = bp_loggedin_user_domain();
$leader_fullname = bp_get_loggedin_user_fullname();
// else we do a lookup for the user domain and display name of the leader
} else {
$leader_domain = bp_core_get_user_domain($r['leader_id']);
$leader_fullname = bp_core_get_user_displayname($r['leader_id']);
}
// setup some variables
if ($is_following) {
$id = 'following';
$action = 'stop';
$class = 'unfollow';
$link_text = sprintf(_x('Unfollow', 'Button', 'bp-follow'), apply_filters('bp_follow_leader_name', bp_get_user_firstname($leader_fullname), $r['leader_id']));
if (empty($r['link_text'])) {
$r['link_text'] = $link_text;
}
} else {
$id = 'not-following';
$action = 'start';
$class = 'follow';
$link_text = sprintf(_x('Follow', 'Button', 'bp-follow'), apply_filters('bp_follow_leader_name', bp_get_user_firstname($leader_fullname), $r['leader_id']));
if (empty($r['link_text'])) {
$r['link_text'] = $link_text;
}
}
$wrapper_class = 'follow-button ' . $id;
if (!empty($r['wrapper_class'])) {
$wrapper_class .= ' ' . esc_attr($r['wrapper_class']);
}
$link_class = $class;
if (!empty($r['link_class'])) {
$link_class .= ' ' . esc_attr($r['link_class']);
}
// make sure we can view the button if a user is on their own page
$block_self = empty($members_template->member) ? true : false;
// if we're using AJAX and a user is on their own profile, we need to set
// block_self to false so the button shows up
if (bp_follow_is_doing_ajax() && bp_is_my_profile()) {
$block_self = false;
}
// setup the button arguments
$button = array('id' => $id, 'component' => 'follow', 'must_be_logged_in' => true, 'block_self' => $block_self, 'wrapper_class' => $wrapper_class, 'wrapper_id' => 'follow-button-' . (int) $r['leader_id'], 'link_href' => wp_nonce_url($leader_domain . $bp->follow->followers->slug . '/' . $action . '/', $action . '_following'), 'link_text' => esc_attr($r['link_text']), 'link_title' => esc_attr($r['link_title']), 'link_id' => $class . '-' . (int) $r['leader_id'], 'link_class' => $link_class, 'wrapper' => !empty($r['wrapper']) ? esc_attr($r['wrapper']) : false);
// Filter and return the HTML button
return bp_get_button(apply_filters('bp_follow_get_add_follow_button', $button, $r['leader_id'], $r['follower_id']));
}
示例9: bp_loggedin_user_domain
<div id="user-left" name="user-left" class="sidebar sidebar-left">
<div id="user-info" class="row section hidden-xs hidden-sm">
<div class="col-xs-12 col-sm-12 col-lg-12">
<a href="<?php
echo bp_loggedin_user_domain();
?>
">
<?php
bp_loggedin_user_avatar('width=150&height=150');
?>
</a>
</div>
<div class="col-xs-12 col-sm-12 col-lg-12" style="text-align: center">
<h4 style="font-size: 1.4em"><?php
echo bp_get_loggedin_user_fullname();
?>
</h4>
<span class="username">@<?php
echo bp_get_loggedin_user_username();
?>
</span>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<nav class="nav" role="navigation">
<div class="row">
<div class="navbar-header panel hidden-md hidden-lg" style="background-color: #fff; text-align: center">
<h4 class="no-margin">
示例10: kleo_bp_replace_placeholders
function kleo_bp_replace_placeholders($output)
{
$initial_output = $output;
if (strpos($output, '##profile_link##') !== false) {
if (!is_user_logged_in()) {
return '';
}
if (function_exists('bp_is_active')) {
$logged_in_link = bp_loggedin_user_domain('/');
$output = str_replace('##profile_link##', $logged_in_link, $output);
} elseif (class_exists('bbPress')) {
//$logged_in_link = bb_get_profile_link();
$logged_in_link = bbp_get_user_profile_url(bbp_get_current_user_id());
$output = str_replace('##profile_link##', $logged_in_link, $output);
}
}
if (strpos($output, '##member_name##') !== false) {
if (!is_user_logged_in()) {
return '';
}
if (function_exists('bp_is_active')) {
$logged_in_username = bp_get_loggedin_user_fullname();
$output = str_replace('##member_name##', $logged_in_username, $output);
} elseif (class_exists('bbPress')) {
$logged_in_username = bbp_get_user_nicename(bbp_get_current_user_id());
$output = str_replace('##member_name##', $logged_in_username, $output);
}
}
$output = apply_filters('kleo_bp_replace_placeholders', $output, $initial_output);
return $output;
}
示例11: bp_loggedin_user_fullname
function bp_loggedin_user_fullname()
{
echo bp_get_loggedin_user_fullname();
}
示例12: bp_compliments_get_add_compliment_button
/**
* Returns a compliment button for a given user.
*
* @since 0.0.1
* @package BuddyPress_Compliments
*
* @global object $bp BuddyPress instance.
* @global object $members_template Members template object.
* @param array|string $args {
* Attributes of the $args.
*
* @type int $receiver_id Compliment receiver ID.
* @type int $sender_id Compliment sender ID.
* @type string $link_text Link text.
* @type string $link_title Link title.
* @type string $wrapper_class Link wrapper class.
* @type string $link_class Link class. Default "compliments-popup".
* @type string $wrapper Link wrapper. Default "div".
*
* }
* @return string Button HTML.
*/
function bp_compliments_get_add_compliment_button($args = '')
{
global $bp, $members_template;
$r = wp_parse_args($args, array('receiver_id' => bp_displayed_user_id(), 'sender_id' => bp_loggedin_user_id(), 'link_text' => '', 'link_title' => '', 'wrapper_class' => '', 'link_class' => 'compliments-popup', 'wrapper' => 'div'));
if (!$r['receiver_id'] || !$r['sender_id']) {
return false;
}
// if the logged-in user is the receiver, use already-queried variables
if (bp_loggedin_user_id() && $r['receiver_id'] == bp_loggedin_user_id()) {
$receiver_domain = bp_loggedin_user_domain();
$receiver_fullname = bp_get_loggedin_user_fullname();
// else we do a lookup for the user domain and display name of the receiver
} else {
$receiver_domain = bp_core_get_user_domain($r['receiver_id']);
$receiver_fullname = bp_core_get_user_displayname($r['receiver_id']);
}
// setup some variables
$id = 'compliments';
$action = 'start';
$class = 'compliments';
/**
* Filters the compliment receiver name.
*
* @since 0.0.1
* @package BuddyPress_Compliments
*
* @param string $receiver_fullname Receiver full name.
* @param int $r['receiver_id'] Receiver ID.
*/
$link_text = sprintf(sprintf(__('Send %s', 'bp-compliments'), BP_COMP_SINGULAR_NAME), apply_filters('bp_compliments_receiver_name', bp_get_user_firstname($receiver_fullname), $r['receiver_id']));
if (empty($r['link_text'])) {
$r['link_text'] = $link_text;
}
$wrapper_class = 'compliments-button ' . $id;
if (!empty($r['wrapper_class'])) {
$wrapper_class .= ' ' . esc_attr($r['wrapper_class']);
}
$link_class = $class;
if (!empty($r['link_class'])) {
$link_class .= ' ' . esc_attr($r['link_class']);
}
// make sure we can view the button if a user is on their own page
$block_self = empty($members_template->member) ? true : false;
// if we're using AJAX and a user is on their own profile, we need to set
// block_self to false so the button shows up
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' && bp_is_my_profile()) {
$block_self = false;
}
// setup the button arguments
$button = array('id' => $id, 'component' => 'compliments', 'must_be_logged_in' => true, 'block_self' => $block_self, 'wrapper_class' => $wrapper_class, 'wrapper_id' => 'compliments-button-' . (int) $r['receiver_id'], 'link_href' => wp_nonce_url($receiver_domain . $bp->compliments->compliments->slug . '/' . $action . '/', $action . '_compliments'), 'link_text' => esc_attr($r['link_text']), 'link_title' => esc_attr($r['link_title']), 'link_id' => $class . '-' . (int) $r['receiver_id'], 'link_class' => $link_class, 'wrapper' => !empty($r['wrapper']) ? esc_attr($r['wrapper']) : false);
// Filter and return the HTML button
/**
* Filters the compliment button.
*
* @since 0.0.1
* @package BuddyPress_Compliments
*
* @param string $button Button HTML.
* @param int $r['receiver_id'] Receiver ID.
* @param int $r['sender_id'] Sender ID.
*/
return bp_get_button(apply_filters('bp_compliments_get_add_compliment_button', $button, $r['receiver_id'], $r['sender_id']));
}
示例13: bp_loggedin_user_domain
<div id="whats-new-avatar">
<a href="<?php
echo bp_loggedin_user_domain();
?>
">
<?php
bp_loggedin_user_avatar('width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height());
?>
</a>
</div>
<p class="activity-greeting"><?php
if (bp_is_group()) {
printf(__("What's new in %s, %s?", 'buddypress'), bp_get_group_name(), bp_get_user_firstname(bp_get_loggedin_user_fullname()));
} else {
printf(__("What's new, %s?", 'buddypress'), bp_get_user_firstname(bp_get_loggedin_user_fullname()));
}
?>
</p>
<div id="whats-new-content">
<div id="whats-new-textarea">
<textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"
<?php
if (bp_is_group()) {
?>
data-suggestions-group-id="<?php
echo esc_attr((int) bp_get_current_group_id());
?>
" <?php
}
示例14: bp_loggedin_user_domain
?>
<div id="whats-new-avatar">
<a href="<?php
echo bp_loggedin_user_domain();
?>
">
<?php
bp_loggedin_user_avatar('type=full&width=' . bp_core_avatar_full_width() . '&height=' . bp_core_avatar_full_height());
?>
</a>
</div>
<p class="activity-greeting">
<?php
printf(__("Welcome back, %s", 'buddypress'), bp_get_user_firstname(bp_get_loggedin_user_fullname()));
?>
</p>
<?php
wp_nonce_field('post_update', '_wpnonce_post_update');
?>
<?php
/**
* Fires after the activity post form.
*
* @since 1.2.0
*/
do_action('bp_after_activity_post_form');
?>
示例15: setup_terms
/**
* Gets the id of the taxonomy term associated with the item
*
* @since 1.0-beta
*
* @return str $view The current item type
*/
function setup_terms()
{
global $bp;
$this->term_id = bp_docs_get_item_term_id($this->item_id, $this->item_type, $this->item_name);
if (bp_is_user()) {
// If this is a User Doc, then the user_term_id is the same as the term_id
$this->user_term_id = $this->term_id;
} else {
$this->user_term_id = bp_docs_get_item_term_id($this->item_id, 'user', bp_get_loggedin_user_fullname());
}
}