本文整理汇总了PHP中bp_get_loggedin_user_link函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_loggedin_user_link函数的具体用法?PHP bp_get_loggedin_user_link怎么用?PHP bp_get_loggedin_user_link使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_loggedin_user_link函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ds_add_top_header
function ds_add_top_header()
{
global $current_user;
get_currentuserinfo();
if (class_exists('BuddyPress')) {
$user_link = bp_get_loggedin_user_link() . 'settings/';
} else {
$user_link = get_author_posts_url($current_user->ID);
}
?>
<div class="ds-top-header">
<div class="container">
<div class="ds-top-header-inner">
<div class="ds-top-head-left">
<?php
echo get_bloginfo('description', 'display');
?>
</div>
<div class="ds-top-head-right">
<?php
wp_nav_menu(array('theme_location' => 'social-menu', 'container_class' => 'social_menu_class', 'menu_class' => 'ds-top-menu-ul'));
?>
</div>
</div>
</div>
</div>
<?php
}
示例2: bp_loggedin_user_link
/**
* Output the link for the logged-in user's profile.
*/
function bp_loggedin_user_link()
{
echo bp_get_loggedin_user_link();
}
示例3: test_get_with_display_comments_stream
/**
* @group get
*/
public function test_get_with_display_comments_stream()
{
$now = time();
$a1 = $this->factory->activity->create(array('content' => 'Life Rules', 'recorded_time' => date('Y-m-d H:i:s', $now)));
$a2 = $this->factory->activity->create(array('content' => 'Life Drools', 'recorded_time' => date('Y-m-d H:i:s', $now - 100)));
// bp_activity_new_comment() doesn't allow date_recorded
$a3 = bp_activity_add(array('action' => sprintf(__('%s posted a new activity comment', 'buddypress'), bp_get_loggedin_user_link()), 'content' => 'Candy is good', 'component' => buddypress()->activity->id, 'type' => 'activity_comment', 'user_id' => bp_loggedin_user_id(), 'item_id' => $a1, 'secondary_item_id' => $a1, 'recorded_time' => date('Y-m-d H:i:s', $now - 50)));
$activity = BP_Activity_Activity::get(array('display_comments' => 'stream'));
$ids = wp_list_pluck($activity['activities'], 'id');
$this->assertEquals(array($a1, $a3, $a2), $ids);
}
示例4: kleo_comment_form
/**
* Outputs a complete commenting form for use within a template.
* Most strings and form fields may be controlled through the $args array passed
* into the function, while you may also choose to use the comment_form_default_fields
* filter to modify the array of default fields if you'd just like to add a new
* one or remove a single field. All fields are also individually passed through
* a filter of the form comment_form_field_$name where $name is the key used
* in the array of fields.
*
* @param array $args Options for strings, fields etc in the form
* @param mixed $post_id Post ID to generate the form for, uses the current post if null
* @return void
*/
function kleo_comment_form($args = array(), $post_id = null)
{
global $id;
$user = wp_get_current_user();
$user_identity = $user->exists() ? $user->display_name : '';
if (null === $post_id) {
$post_id = $id;
} else {
$id = $post_id;
}
if (comments_open($post_id)) {
?>
<div id="respond-wrap">
<?php
$commenter = wp_get_current_commenter();
$req = get_option('require_name_email');
$aria_req = $req ? " aria-required='true'" : '';
$fields = array('author' => '<div class="row"><p class="comment-form-author col-sm-4"><label for="author">' . __('Name', 'kleo_framework') . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '<input id="author" name="author" type="text" class="form-control" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></p>', 'email' => '<p class="comment-form-email col-sm-4"><label for="email">' . __('Email', 'kleo_framework') . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '<input id="email" name="email" type="text" class="form-control" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></p>', 'url' => '<p class="comment-form-url col-sm-4"><label for="url">' . __('Website', 'kleo_framework') . '</label><input id="url" name="url" type="text" class="form-control" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p></div>');
if (function_exists('bp_is_active')) {
$profile_link = bp_get_loggedin_user_link();
} else {
$profile_link = admin_url('profile.php');
}
$comments_args = array('fields' => apply_filters('comment_form_default_fields', $fields), 'logged_in_as' => '<p class="logged-in-as">' . sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'kleo_framework'), $profile_link, $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</p>', 'title_reply' => __('Leave a reply', 'kleo_framework'), 'title_reply_to' => __('Leave a reply to %s', 'kleo_framework'), 'cancel_reply_link' => __('Click here to cancel the reply', 'kleo_framework'), 'label_submit' => __('Post comment', 'kleo_framework'), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . __('Comment', 'kleo_framework') . '</label><textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'kleo_framework'), wp_login_url(apply_filters('the_permalink', get_permalink()))) . '</p>');
comment_form($comments_args);
?>
</div>
<?php
}
}
示例5: do_action
<div id="item-buttons">
<?php
do_action('bp_member_header_actions');
?>
</div><!-- #item-buttons -->
<?php
/* Show Quick Menu for own Profile page */
if (bp_is_my_profile()) {
?>
<div id="profile-nav-menu">
<?php
$userLink = bp_get_loggedin_user_link();
?>
<ul>
<li id="edit-profile">
<a class="button edit-profile-button" href="<?php
echo $userLink;
?>
profile/edit"><?php
_e('Edit My Profile', 'buddypress');
?>
</a>
</li>
<li id="edit-avatar">
<a class="button edit-avatar-button" href="<?php
echo $userLink;
?>
示例6: child_wplms_get_mycred_link
function child_wplms_get_mycred_link()
{
$mycred = get_option('mycred_pref_core');
if (isset($mycred['buddypress']) && isset($mycred['buddypress']['history_url']) && isset($mycred['buddypress']['history_location']) && $mycred['buddypress']['history_location']) {
$link = bp_get_loggedin_user_link() . $mycred['buddypress']['history_url'];
} else {
$link = '#';
}
return $link;
}
示例7: do_action
<div id="message-thread">
<?php do_action( 'bp_before_message_thread_content' ) ?>
<?php if ( bp_thread_has_messages() ) : ?>
<h3 id="message-subject"><?php bp_the_thread_subject() ?></h3>
<p id="message-recipients">
<span class="highlight">
<?php printf( __('Sent between %s and %s', 'buddypress'), bp_get_the_thread_recipients(), '<a href="' . bp_get_loggedin_user_link() . '" title="' . bp_get_loggedin_user_fullname() . '">' . bp_get_loggedin_user_fullname() . '</a>' ) ?>
</span>
</p>
<?php do_action( 'bp_before_message_thread_list' ) ?>
<?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?>
<div class="message-box">
<div class="message-metadata">
<?php do_action( 'bp_before_message_meta' ) ?>
<?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ) ?>
<strong><a href="<?php bp_the_thread_message_sender_link() ?>" title="<?php bp_the_thread_message_sender_name() ?>"><?php bp_the_thread_message_sender_name() ?></a> <span class="activity"><?php bp_the_thread_message_time_since() ?></span></strong>
<?php do_action( 'bp_after_message_meta' ) ?>
</div><!-- .message-metadata -->
示例8: bp_record_vote_activity
function bp_record_vote_activity($site_id, $blog_id, $post_id, $vote)
{
if (!bp_loggedin_user_id()) {
return false;
}
$username = bp_get_loggedin_user_fullname();
$username = $username ? $username : bp_get_loggedin_user_username();
if (!$username) {
return false;
}
$user_link = bp_get_loggedin_user_link();
$link = get_blog_permalink($blog_id, $post_id);
$post = get_blog_post($blog_id, $post_id);
$title = $post->post_title;
$args = array('action' => sprintf(__('<a href="%s">%s</a> voted on <a href="%s">%s</a>', 'wdpv'), $user_link, $username, $link, $title), 'component' => 'wdpv_post_vote', 'type' => 'wdpv_post_vote', 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'hide_sitewide' => $this->data->get_option('bp_publish_activity_local'));
$res = bp_activity_add($args);
return $res;
}
示例9: bp_loggedin_user_link
/**
* Output the link for the logged-in user's profile.
*
* @since 1.2.4
*/
function bp_loggedin_user_link()
{
echo esc_url(bp_get_loggedin_user_link());
}
示例10: do_action
<?php
do_action('wf_open_bp_navigation_menu');
?>
<?php
if (is_user_logged_in()) {
?>
<?php
wff_bp_notifications_menu();
?>
<li id="bp-profile-menu" class="dropdown menu-groups">
<a href="<?php
echo bp_get_loggedin_user_link();
?>
" data-target="#" data-toggle="dropdown"
class="dropdown-toggle"><?php
echo bp_loggedin_user_avatar('type=thumb&width=70&height=70');
?>
<?php
if (get_theme_mod('wf_plus_bp_menu_user_name', 'no') == 'yes') {
?>
<span class="bp-profile-menu-name">
<?php
echo bp_core_get_user_displayname(bp_loggedin_user_id());
?>
</span>
<?php
} else {
示例11: getUserEmailSettingsURL
public function getUserEmailSettingsURL()
{
$url = bp_get_loggedin_user_link();
$url .= self::EMAIL_SETTINGS_URL_STRING;
return $url;
}
示例12: bp_links_setup_admin_bar
function bp_links_setup_admin_bar()
{
global $bp, $wp_admin_bar;
// user must be logged in
if (false == is_user_logged_in()) {
// abort
return;
}
// base link
$links_link = $bp->loggedin_user->domain . bp_links_slug() . '/';
// add top level
$wp_admin_bar->add_menu(array('parent' => $bp->my_account_menu_id, 'id' => 'my-account-' . $bp->links->id, 'title' => __('Links', 'buddypress-links'), 'href' => trailingslashit($links_link)));
// add list sub
$wp_admin_bar->add_menu(array('parent' => 'my-account-' . $bp->links->id, 'id' => 'my-account-' . $bp->links->id . '-list', 'title' => __('List', 'buddypress-links'), 'href' => bp_get_loggedin_user_link() . $bp->links->slug));
// add create sub
$wp_admin_bar->add_menu(array('parent' => 'my-account-' . $bp->links->id, 'id' => 'my-account-' . $bp->links->id . '-create', 'title' => __('Create', 'buddypress-links'), 'href' => bp_get_loggedin_user_link() . $bp->links->slug . '/create'));
}