本文整理汇总了PHP中bp_get_settings_slug函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_settings_slug函数的具体用法?PHP bp_get_settings_slug怎么用?PHP bp_get_settings_slug使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_settings_slug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: friends_notification_accepted_request
function friends_notification_accepted_request($friendship_id, $initiator_id, $friend_id)
{
$friend_name = bp_core_get_user_displayname($friend_id);
if ('no' == bp_get_user_meta((int) $initiator_id, 'notification_friends_friendship_accepted', true)) {
return false;
}
$ud = get_userdata($initiator_id);
$friend_link = bp_core_get_user_domain($friend_id);
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = trailingslashit(bp_core_get_user_domain($initiator_id) . $settings_slug . '/notifications');
// Set up and send the message
$to = $ud->user_email;
$subject = bp_get_email_subject(array('text' => sprintf(__('%s accepted your friendship request', 'buddypress'), $friend_name)));
$message = sprintf(__('%1$s accepted your friend request.
To view %2$s\'s profile: %3$s
---------------------
', 'buddypress'), $friend_name, $friend_name, $friend_link);
// Only show the disable notifications line if the settings component is enabled
if (bp_is_active('settings')) {
$message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
}
/* Send the message */
$to = apply_filters('friends_notification_accepted_request_to', $to);
$subject = apply_filters('friends_notification_accepted_request_subject', $subject, $friend_name);
$message = apply_filters('friends_notification_accepted_request_message', $message, $friend_name, $friend_link, $settings_link);
wp_mail($to, $subject, $message);
do_action('bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id);
}
示例2: friends_notification_accepted_request
function friends_notification_accepted_request($friendship_id, $initiator_id, $friend_id)
{
global $bp;
$friendship = new BP_Friends_Friendship($friendship_id, false, false);
$friend_name = bp_core_get_user_displayname($friend_id);
if ('no' == bp_get_user_meta((int) $initiator_id, 'notification_friends_friendship_accepted', true)) {
return false;
}
$ud = get_userdata($initiator_id);
$friend_link = bp_core_get_user_domain($friend_id);
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = bp_core_get_user_domain($initiator_id) . $settings_slug . '/notifications';
// Set up and send the message
$to = $ud->user_email;
$sitename = nxt_specialchars_decode(get_blog_option(bp_get_root_blog_id(), 'blogname'), ENT_QUOTES);
$subject = '[' . $sitename . '] ' . sprintf(__('%s accepted your friendship request', 'buddypress'), $friend_name);
$message = sprintf(__('%1$s accepted your friend request.
To view %2$s\'s profile: %3$s
---------------------
', 'buddypress'), $friend_name, $friend_name, $friend_link);
$message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
/* Send the message */
$to = apply_filters('friends_notification_accepted_request_to', $to);
$subject = apply_filters('friends_notification_accepted_request_subject', $subject, $friend_name);
$message = apply_filters('friends_notification_accepted_request_message', $message, $friend_name, $friend_link, $settings_link);
nxt_mail($to, $subject, $message);
do_action('bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id);
}
示例3: 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');
}
示例4: 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;
}
示例5: messages_notification_new_message
function messages_notification_new_message($args = array())
{
// These should be extracted below
$recipients = array();
$email_subject = $email_content = '';
extract($args);
$sender_name = bp_core_get_user_displayname($sender_id);
// Bail if no recipients
if (!empty($recipients)) {
foreach ($recipients as $recipient) {
if ($sender_id == $recipient->user_id || 'no' == bp_get_user_meta($recipient->user_id, 'notification_messages_new_message', true)) {
continue;
}
// User data and links
$ud = get_userdata($recipient->user_id);
// Bail if user cannot be found
if (empty($ud)) {
continue;
}
$message_link = bp_core_get_user_domain($recipient->user_id) . bp_get_messages_slug() . '/';
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = bp_core_get_user_domain($recipient->user_id) . $settings_slug . '/notifications/';
// Sender info
$sender_name = stripslashes($sender_name);
$subject = stripslashes(wp_filter_kses($subject));
$content = stripslashes(wp_filter_kses($content));
// Set up and send the message
$email_to = $ud->user_email;
$email_subject = bp_get_email_subject(array('text' => sprintf(__('New message from %s', 'buddypress'), $sender_name)));
$email_content = sprintf(__('%1$s sent you a new message:
Subject: %2$s
"%3$s"
To view and read your messages please log in and visit: %4$s
---------------------
', 'buddypress'), $sender_name, $subject, $content, $message_link);
// Only show the disable notifications line if the settings component is enabled
if (bp_is_active('settings')) {
$email_content .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
}
// Send the message
$email_to = apply_filters('messages_notification_new_message_to', $email_to);
$email_subject = apply_filters('messages_notification_new_message_subject', $email_subject, $sender_name);
$email_content = apply_filters('messages_notification_new_message_message', $email_content, $sender_name, $subject, $content, $message_link, $settings_link);
wp_mail($email_to, $email_subject, $email_content);
}
}
do_action('bp_messages_sent_notification_email', $recipients, $email_subject, $email_content, $args);
}
示例6: messages_notification_new_message
function messages_notification_new_message($args = array())
{
// These should be extracted below
$recipients = array();
$email_subject = $email_content = '';
extract($args);
$sender_name = bp_core_get_user_displayname($sender_id);
// Bail if no recipients
if (!empty($recipients)) {
foreach ($recipients as $recipient) {
if ($sender_id == $recipient->user_id || 'no' == bp_get_user_meta($recipient->user_id, 'notification_messages_new_message', true)) {
continue;
}
// User data and links
$ud = get_userdata($recipient->user_id);
$message_link = bp_core_get_user_domain($recipient->user_id) . bp_get_messages_slug() . '/';
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = bp_core_get_user_domain($recipient->user_id) . $settings_slug . '/notifications/';
// Sender info
$sender_name = stripslashes($sender_name);
$subject = stripslashes(wp_filter_kses($subject));
$content = stripslashes(wp_filter_kses($content));
// Set up and send the message
$email_to = $ud->user_email;
$sitename = wp_specialchars_decode(get_blog_option(bp_get_root_blog_id(), 'blogname'), ENT_QUOTES);
$email_subject = '[' . $sitename . '] ' . sprintf(__('New message from %s', 'buddypress'), $sender_name);
$email_content = sprintf(__('%1$s sent you a new message:
Subject: %2$s
"%3$s"
To view and read your messages please log in and visit: %4$s
---------------------
', 'buddypress'), $sender_name, $subject, $content, $message_link);
$email_content .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
// Send the message
$email_to = apply_filters('messages_notification_new_message_to', $email_to);
$email_subject = apply_filters('messages_notification_new_message_subject', $email_subject, $sender_name);
$email_content = apply_filters('messages_notification_new_message_message', $email_content, $sender_name, $subject, $content, $message_link, $settings_link);
wp_mail($email_to, $email_subject, $email_content);
}
}
do_action('bp_messages_sent_notification_email', $recipients, $email_subject, $email_content, $args);
}
示例7: bp_settings_pending_email_notice
/**
* Add the 'pending email change' message to the settings page.
*
* @since BuddyPress (2.1.0)
*/
function bp_settings_pending_email_notice()
{
$pending_email = bp_get_user_meta(bp_displayed_user_id(), 'pending_email_change', true);
if (empty($pending_email['newemail'])) {
return;
}
if (bp_get_displayed_user_email() == $pending_email['newemail']) {
return;
}
?>
<div id="message" class="bp-template-notice error">
<p><?php
printf(__('There is a pending change of your email address to <code>%1$s</code>.<br />Check your email (<code>%2$s</code>) for the verification link. <a href="%3$s">Cancel</a>', 'buddypress'), $pending_email['newemail'], bp_get_displayed_user_email(), esc_url(bp_displayed_user_domain() . bp_get_settings_slug() . '/?dismiss_email_change=1'));
?>
</p>
</div>
<?php
}
示例8: dpa_achievement_unlocked_notification
/**
* Sends the email notification to the user when an Achievement is unlocked.
*
* @global object $bp BuddyPress global settings
* @global nxtdb $nxtdb NXTClass database object
* @param int $achievement_id
* @param int $user_id
* @since 2.0
*/
function dpa_achievement_unlocked_notification($achievement_id, $user_id)
{
global $achievements_template, $bp, $nxtdb;
if ('no' == get_user_meta($user_id, 'notification_dpa_unlock_achievement', true)) {
return;
}
$recipient = get_userdata($user_id);
$settings_link = bp_core_get_user_domain($user_id) . bp_get_settings_slug() . '/notifications/';
$achievements_link = bp_core_get_user_domain($user_id) . DPA_SLUG . '/';
$email_subject = sprintf(__('[%1$s] Achievement unlocked: %2$s', 'dpa'), nxt_specialchars_decode(get_blog_option(BP_ROOT_BLOG, 'blogname'), ENT_QUOTES), dpa_get_achievement_name());
$email_content = sprintf(__('
You have unlocked an Achievement: %1$s
To review this and see all of your Achievements, go to %2$s
---------------------
To disable these notifications please log in and go to: %3$s', 'dpa'), dpa_get_achievement_name(), $achievements_link, $settings_link);
// Send the message
$email_to = apply_filters('dpa_unlock_achievement_notification_to', $recipient->user_email, $achievement_id);
$email_subject = apply_filters('dpa_unlock_achievement_notification_subject', $email_subject, $achievement_id);
$email_content = apply_filters('dpa_unlock_achievement_notification_message', $email_content, $achievement_id, $achievements_link, $settings_link);
nxt_mail($email_to, $email_subject, $email_content);
}
示例9: groups_notification_group_invites
function groups_notification_group_invites(&$group, &$member, $inviter_user_id)
{
// @todo $inviter_up may be used for caching, test without it
$inviter_ud = bp_core_get_core_userdata($inviter_user_id);
$inviter_name = bp_core_get_userlink($inviter_user_id, true, false, true);
$inviter_link = bp_core_get_user_domain($inviter_user_id);
$group_link = bp_get_group_permalink($group);
if (!$member->invite_sent) {
$invited_user_id = $member->user_id;
// Post a screen notification first.
bp_core_add_notification($group->id, $invited_user_id, 'groups', 'group_invite');
if ('no' == bp_get_user_meta($invited_user_id, 'notification_groups_invite', true)) {
return false;
}
$invited_ud = bp_core_get_core_userdata($invited_user_id);
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = bp_core_get_user_domain($invited_user_id) . $settings_slug . '/notifications/';
$invited_link = bp_core_get_user_domain($invited_user_id);
$invites_link = trailingslashit($invited_link . bp_get_groups_slug() . '/invites');
// Set up and send the message
$to = $invited_ud->user_email;
$subject = bp_get_email_subject(array('text' => sprintf(__('You have an invitation to the group: "%s"', 'buddypress'), $group->name)));
$message = sprintf(__('One of your friends %1$s has invited you to the group: "%2$s".
To view your group invites visit: %3$s
To view the group visit: %4$s
To view %5$s\'s profile visit: %6$s
---------------------
', 'buddypress'), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link);
// Only show the disable notifications line if the settings component is enabled
if (bp_is_active('settings')) {
$message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
}
/* Send the message */
$to = apply_filters('groups_notification_group_invites_to', $to);
$subject = apply_filters_ref_array('groups_notification_group_invites_subject', array($subject, &$group));
$message = apply_filters_ref_array('groups_notification_group_invites_message', array($message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link));
wp_mail($to, $subject, $message);
do_action('bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group);
}
}
示例10: rt_privacy_settings_action
/**
* changing and saving of privacy setting save action
*/
function rt_privacy_settings_action()
{
if (buddypress()->current_action != 'privacy') {
return;
}
if (isset($_POST["rtmedia-default-privacy"])) {
$status = false;
if (wp_verify_nonce($_POST['rtmedia_member_settings_privacy'], 'rtmedia_member_settings_privacy')) {
$status = update_user_meta(get_current_user_id(), 'rtmedia-default-privacy', $_POST["rtmedia-default-privacy"]);
}
if (false == $status) {
$feedback = __('No changes were made to your account.', 'buddypress-media');
$feedback_type = 'error';
} else {
if (true == $status) {
$feedback = __('Your default privacy settings saved successfully.', 'buddypress-media');
$feedback_type = 'success';
}
}
bp_core_add_message($feedback, $feedback_type);
do_action('bp_core_general_settings_after_save');
bp_core_redirect(bp_displayed_user_domain() . bp_get_settings_slug() . '/privacy/');
}
}
示例11: bp_settings_slug
/**
* Output the settings component slug
*
* @package BuddyPress
* @subpackage SettingsTemplate
* @since BuddyPress (1.5)
*
* @uses bp_get_settings_slug()
*/
function bp_settings_slug()
{
echo bp_get_settings_slug();
}
示例12: groups_notification_group_invites
/**
* Notify a member they have been invited to a group.
*
* @since 1.0.0
*
* @param BP_Groups_Group $group Group object.
* @param BP_Groups_Member $member Member object.
* @param int $inviter_user_id ID of the user who sent the invite.
* @return null|false False on failure.
*/
function groups_notification_group_invites(&$group, &$member, $inviter_user_id)
{
// Bail if member has already been invited.
if (!empty($member->invite_sent)) {
return;
}
// @todo $inviter_ud may be used for caching, test without it
$inviter_ud = bp_core_get_core_userdata($inviter_user_id);
$inviter_name = bp_core_get_userlink($inviter_user_id, true, false, true);
$inviter_link = bp_core_get_user_domain($inviter_user_id);
$group_link = bp_get_group_permalink($group);
// Setup the ID for the invited user.
$invited_user_id = $member->user_id;
// Trigger a BuddyPress Notification.
if (bp_is_active('notifications')) {
bp_notifications_add_notification(array('user_id' => $invited_user_id, 'item_id' => $group->id, 'component_name' => buddypress()->groups->id, 'component_action' => 'group_invite'));
}
// Bail if member opted out of receiving this email.
if ('no' === bp_get_user_meta($invited_user_id, 'notification_groups_invite', true)) {
return false;
}
$invited_ud = bp_core_get_core_userdata($invited_user_id);
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = bp_core_get_user_domain($invited_user_id) . $settings_slug . '/notifications/';
$invited_link = bp_core_get_user_domain($invited_user_id);
$invites_link = trailingslashit($invited_link . bp_get_groups_slug() . '/invites');
// Set up and send the message.
$to = $invited_ud->user_email;
$subject = bp_get_email_subject(array('text' => sprintf(__('You have an invitation to the group: "%s"', 'buddypress'), $group->name)));
$message = sprintf(__('One of your friends %1$s has invited you to the group: "%2$s".
To view your group invites visit: %3$s
To view the group visit: %4$s
To view %5$s\'s profile visit: %6$s
---------------------
', 'buddypress'), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link);
// Only show the disable notifications line if the settings component is enabled.
if (bp_is_active('settings')) {
$message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
}
/**
* Filters the user email that the group invite notification will be sent to.
*
* @since 1.2.0
*
* @param string $to User email the invite notification is being sent to.
*/
$to = apply_filters('groups_notification_group_invites_to', $to);
/**
* Filters the group invite notification subject that will be sent to user.
*
* @since 1.2.0
*
* @param string $subject Invite notification email subject text.
* @param BP_Groups_Group $group Object holding the current group instance. Passed by reference.
*/
$subject = apply_filters_ref_array('groups_notification_group_invites_subject', array($subject, &$group));
/**
* Filters the group invite notification message that will be sent to user.
*
* @since 1.2.0
*
* @param string $message Invite notification email message text.
* @param BP_Groups_Group $group Object holding the current group instance. Passed by reference.
* @param string $inviter_name Username for the person doing the inviting.
* @param string $inviter_link Profile link for the person doing the inviting.
* @param string $invites_link URL permalink for the invited user's invite management screen.
* @param string $group_link URL permalink for the group that the invite was related to.
* @param string $settings_link URL permalink for the user's notification settings area.
*/
$message = apply_filters_ref_array('groups_notification_group_invites_message', array($message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link));
wp_mail($to, $subject, $message);
/**
* Fires after the notification is sent that a member has been invited to a group.
*
* @since 1.5.0
*
* @param int $invited_user_id ID of the user who was invited.
* @param string $subject Email notification subject text.
* @param string $message Email notification message text.
* @param BP_Groups_Group $group Group object.
*/
do_action('bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group);
}
示例13: groups_at_message_notification
/**
* Send an email and a BP notification on receipt of an @-mention in a group
*
* @deprecated 1.5
* @deprecated Deprecated in favor of the more general bp_activity_at_message_notification()
*/
function groups_at_message_notification($content, $poster_user_id, $group_id, $activity_id)
{
global $bp;
_deprecated_function(__FUNCTION__, '1.5', 'bp_activity_at_message_notification()');
/* Scan for @username strings in an activity update. Notify each user. */
$pattern = '/[@]+([A-Za-z0-9-_\\.@]+)/';
preg_match_all($pattern, $content, $usernames);
/* Make sure there's only one instance of each username */
if (!($usernames = array_unique($usernames[1]))) {
return false;
}
$group = new BP_Groups_Group($group_id);
foreach ((array) $usernames as $username) {
if (!($receiver_user_id = bp_core_get_userid($username))) {
continue;
}
/* Check the user is a member of the group before sending the update. */
if (!groups_is_user_member($receiver_user_id, $group_id)) {
continue;
}
// Now email the user with the contents of the message (if they have enabled email notifications)
if ('no' != bp_get_user_meta($receiver_user_id, 'notification_activity_new_mention', true)) {
$poster_name = bp_core_get_user_displayname($poster_user_id);
$message_link = bp_activity_get_permalink($activity_id);
$settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
$settings_link = bp_core_get_user_domain($receiver_user_id) . $settings_slug . '/notifications/';
$poster_name = stripslashes($poster_name);
$content = bp_groups_filter_kses(stripslashes($content));
// Set up and send the message
$ud = bp_core_get_core_userdata($receiver_user_id);
$to = $ud->user_email;
$sitename = nxt_specialchars_decode(get_blog_option(bp_get_root_blog_id(), 'blogname'), ENT_QUOTES);
$subject = '[' . $sitename . '] ' . sprintf(__('%1$s mentioned you in the group "%2$s"', 'buddypress'), $poster_name, $group->name);
$message = sprintf(__('%1$s mentioned you in the group "%2$s":
"%3$s"
To view and respond to the message, log in and visit: %4$s
---------------------
', 'buddypress'), $poster_name, $group->name, $content, $message_link);
$message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
/* Send the message */
$to = apply_filters('groups_at_message_notification_to', $to);
$subject = apply_filters('groups_at_message_notification_subject', $subject, $group, $poster_name);
$message = apply_filters('groups_at_message_notification_message', $message, $group, $poster_name, $content, $message_link, $settings_link);
nxt_mail($to, $subject, $message);
}
}
do_action('bp_groups_sent_mention_email', $usernames, $subject, $message, $content, $poster_user_id, $group_id, $activity_id);
}
示例14: do_action
/**
* BuddyPress - Members Single Profile
*
* @package BuddyPress
* @subpackage bp-legacy
*/
/**
* Fires before the display of member settings template.
*
* @since 1.5.0
*/
do_action('bp_before_member_settings_template');
?>
<form action="<?php
echo trailingslashit(bp_displayed_user_domain() . bp_get_settings_slug() . '/profile');
?>
" method="post" class="standard-form" id="settings-form">
<?php
if (bp_xprofile_get_settings_fields()) {
?>
<?php
while (bp_profile_groups()) {
bp_the_profile_group();
?>
<?php
if (bp_profile_fields()) {
?>
示例15: x_buddypress_current_member_item_buttons
function x_buddypress_current_member_item_buttons()
{
if (bp_is_my_profile()) {
?>
<div class="generic-button">
<a href="<?php
echo trailingslashit(bp_loggedin_user_domain() . bp_get_settings_slug());
?>
"><?php
_e('Edit Settings', '__x__');
?>
</a>
</div>
<?php
}
}