Untested, but try:
function custom_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
// New custom notifications
if ( 'custom_action' === $action ) {
$custom_title = "You have new custom notification";
$custom_link = get_permalink( $item_id );
$custom_text = "You have a new custom notification";
// WordPress Toolbar
if ( 'string' === $format ) {
$return = apply_filters( 'custom_filter', '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_title ) . '">' . esc_html( $custom_text ) . '</a>', $custom_text, $custom_link );
// Deprecated BuddyBar
} else {
$return = apply_filters( 'custom_filter', array(
'text' => $custom_text,
'link' => $custom_link
), $custom_link, (int) $total_items, $item_id, $secondary_item_id );
}
return $return;
}
}
add_filter( 'bp_notifications_get_notifications_for_user', 'custom_format_buddypress_notifications', 20, 5 );
Hi there,
I was trouble shooting already hosted live website which is already setup buddy press wall.
BuddyPress – Version 4.1.0
BuddyBoss Wall – Version 1.3.2
BuddyBoss Media – Version 3.2.2
BuddyPress Activity Filter – Version 2.0.0
Wordpress – Version 4.9.6
And user can post on there friend profile and see the posted on user wall. But when mentioned user wall doesn’t display it. Any idea what will causing this issue.
But the wall post will notify and notification will be redirect site-wide-activity page display posts on that page, not on their wall.
Ah yes, slight correction required:
<?php $args = array(
'links' => array(
bp_get_the_notification_mark_link( bp_displayed_user_id() )
)
);?>
thanks for your help, I have got the page to only show the unread link but now when you hover over the link, it wont work as the format of the link is wrong, do you know why?
This is the link before (top) and after (bottom)
https://www.dropbox.com/s/zoiencz9qbweanr/links%20before%20and%20after%20change.jpg?dl=0
and this is my code
<?php $args = array(
'links' => array(
bp_get_the_notification_mark_link( $user_id )
)
);?>
<td class="notification-actions"><?php bp_the_notification_action_links( $args ); ?></td>
You are welcome.
When you get to edit the file you will see something like this:
<?php bp_the_notification_action_links(); ?>
The extra code will need to go within a set of PHP tags just like the function call is.
So your code should end up looking something like this:
<?php $args = array(
'links' => array(
bp_get_the_notification_mark_link( $user_id )
)
);?>
place this in a new line before the modified function call:
<?php bp_the_notification_action_links( $args ); ?>
It looks like the function bp_the_notification_action_links() accepts $args that would allow you to remove the delete link. So you could overload your `members/single/notifications/notifications-loop.php file to include something like the following:
$args = array(
'links' => array(
bp_get_the_notification_mark_link( $user_id )
)
);
and add this to the function call: bp_the_notification_links( $args )
Something like that looks like it would work, not tested it though.
Hi
I’m using BuddyPress and upon registration of users, the email notifications are sent using the hosting server which lands 100% of the times at spam folder.
to solve this I’ve installed the WP Mail SMTP plugin but this it didn’t affect BuddyPress Smtp settings.
Please someone with a solution to solve this.
Thanks
Users names do not appear when letters are typed after @
The mention “works” notification wise but the autosuggest (I guess this is what it’s called) doesn’t.
Looking in Chrome Console I have an error:
Uncaught SyntaxError: Invalid or unexpected token mentions.min.js?ver=4.1.0:13
/wp-content/plugins/buddypress/bp-activity/js/mentions.min.js?ver=4.1.0
The error icon is shown at the end of line 13:
11 var i={
12 delay:200,hideWithoutSuffix:!0,insertTpl:”@${
13 ID
14 }
The console also says that (no error icon there though):
JQMIGRATE: Migrate is installed, version 1.4.1 jquery-migrate.min.js?ver=1.4.1:2
/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1
@datenfresser You can find them inside user meta
http://prntscr.com/m7gdur
To set default values you can check previous thread
Email notification default settings
One aspect I forgot was if the user is not logged in, ths would fix that:
const notificationsCounter = document.getElementById('ab-pending-notifications');
const notificationsIndicator = document.getElementById('wp-admin-bar-bp-notifications');
function counterChange() {
if (notificationsCounter.innerText == '0') {
notificationsIndicator.style.display = 'none';
} else {
notificationsIndicator.style.display = 'block';
}
}
if (notificationCounter){
notificationsCounter.addEventListener('change', counterChange);
}
counterChange();
Is there a function to branch pages?
Currently I am supplementing that function with the following code.
$arr = explode( '/', $_SERVER['REQUEST_URI'] );
if ( isset($arr[1]) && $arr[1] === 'members' ) :
if( is_user_logged_in() ) :
if( bp_loggedin_user_id() == bp_displayed_user_id() ) :
if( ( $arr[3] === '' || $arr[3] === 'activity' || $arr[3] === 'profile' || $arr[3] === 'following' || $arr[3] === 'followers' ) && $arr[4] != 'following' && isset($arr[3]) ) :
echo 'hello';
elseif( $arr[3] === 'forums' ) :
echo 'hello';
elseif( $arr[3] === 'bp-messages' || $arr[3] === 'settings' || $arr[3] === 'notifications' || $arr[3] === 'following' ) :
echo 'hello';
endif;
else:
if( ( $arr[3] === '' || $arr[3] === 'activity' || $arr[3] === 'profile' || $arr[3] === 'following' || $arr[3] === 'followers' ) && isset($arr[3]) ) :
echo 'hello';
elseif( $arr[3] === 'forums' && isset($arr[3]) ) :
echo 'hello';
endif;
endif;
else:
echo 'guest';
endif;
endif;
But It’s not cool..
Please inform me if you have a better method to solve the problem than the one previously mentioned.
I have real estate theme. I want web hook notifications such that when a user applies for a property on my site, notification with property details and applicant details should be sent to the owner of that property. Is it possible with buddypress notifications? And If yes, please guide me through the steps.
As you know, with Buddypress users see an email whenever someone sends them a message and they are offline. We have asked repeatedly to your support if Cometchat overrides BP’s direct messaging function at the basic pricing tier? Because Cometchat email notifications are according to your pricing menu are only available to the highest tier Enterprise pricing and that would cost $12,000 US per year! This functionality is something that Buddypress already does, free, so if CometChat ove rides this functionality then we cannot pay you $12,000 to get it back. Are we missing something? We have tried to ask your support this question but have not received a response. Thank you.
Hi there,
So i’ve managed it with a mix of my initial code which i posted firstly and your permalink, so i’ve changed basically this:
$notif = '<span class="noticecount">'. bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) .'</span>';
to this:
$notif = '<a href="' . bp_get_notifications_unread_permalink() . '"><span class="noticecount"><i class="noticecounttitle">Notifications</i>'. bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) .'</span></a>
Ok so far so good, but this alchemy failed badly with my unread messages version.
I tested bp_get_messages_permalink(), or bp_get_unread_messages_permalink() and basically the wierdest combinations one can imagine but nothing worked.
I’ve searched then here the BP froums plus additionally stack overflow but it seems there are so many techniques to link stuff that i’m utterly lost here.
There were also permalink tags with the term slug this and slug that so i thought i ask here again before my head explodes.
Suggestion…
//notification alerts
function my_nav_menu_notif_counter( $menu, $args ) {
if (!is_user_logged_in()) {
return $menu;
} else {
if( $args->theme_location == 'primary' ) {
$unread = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
if ( 0 != $unread ) {
$link = '<a href="' . bp_get_notifications_unread_permalink() . '">Notifications '. $unread . '</a>';
$notif = '<span class="noticecount">' . $link . '</span>';
$menu .= $notif;
}
}
}
return $menu;
}
add_filter( 'wp_nav_menu_items', 'my_nav_menu_notif_counter', 10, 2 );
Hola, tengo el mismo el problema que @doshermanastuciudadhoy no llega el email de confirmación a los dominios hotmail…
Al eliminar el código del archivo bp-core.filters.php la web peta, tambien es cierto que yo tengo la versión 3.2.0… este es el código:
// Add 'List-Unsubscribe' header if applicable.
if ( ! empty( $tokens['unsubscribe'] ) && $tokens['unsubscribe'] !== wp_login_url() ) {
$user = get_user_by( 'email', $tokens['recipient.email'] );
$link = bp_email_get_unsubscribe_link( array(
'user_id' => $user->ID,
'notification_type' => $email->get( 'type' ),
) );
if ( ! empty( $link ) ) {
$headers['List-Unsubscribe'] = sprintf( '<%s>', esc_url_raw( $link ) );
}
}
return $headers;
}
add_filter( 'bp_email_get_headers', 'bp_email_set_default_headers', 6, 4 );
Podrías ayudarme?
Anonymous User 16484011Inactive
Hi !
Prashant,
Thanks again.
Sorry for delay in reply because I want experiments on your above article.
I read the whole third part of your above link. But it’s for making a plugin. I tried direct the changes to a demo wordpress installation php files but it’s not works for me. I mashed up because I haven’t core developer.
Can any other things or plugin solve my problem ?
I found on net about the same problem’s solution. I got the plugin pie for the same.
In this plugin I am able to add forgot password page template. Just go to pie register-> Notification -> Select tab User notification-> select template from dropdown “Password reset request”.
But after user fill password reset form when they click …
1) User got a link with token. I don’t want this ? I send just only token without link like otp.
2) After clicking user must redirect to page where they can paste the key which they received.
3) After pasting the key I have two options…
A) Either user redirect to create a new password and confirm password page.
B) OR user got a new password via mail which auto generated by site to their registered mail id.
Thanks and Regards
Here is my theme and a list of plugins, most of which came with the premium theme. There have been no complaints I’ve found of the groups not working “out-of-the-box” with this theme.
*** These were the only plugins that did NOT come with the theme.
Theme: WOffice
Active Plugins:
- Akismet Anti-spam
- All in one WP Migration
- BP xProfile Location ***
- BuddyPress
- Buddypress Xprofile Fields Custom Css Classes ***
- DP Pro Event Calendar
- Eonet Live Notifications
- File Away
- GamiPress
- LocateAnything ***
- Slider Revolution
- Unyson
- User Role Editor ***(suggested and tested compatible plugin)
- Wise Chat
- WP ERP
- WP ERP – PDF Invoice
- WP Bakery Page Builder
Still no luck getting group creation working.
Thanks for your response! Any ideas?
Please try this code:
add_action('wp_footer','ps_remove_delete_button');
function ps_remove_delete_button(){
if(!current_user_can('manage_options')){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.notifications .delete').hide();
jQuery('.notifications .confirm').each(function() {
if (jQuery(this).text() == 'Delete')
jQuery(this).hide();
});
});
</script>
<?php
}
}
Please check if body tag has class ‘notifications’.
Thanks
Hi. I would love if someone could help me with a few concerns I have regarding emails in relation to BuddyPress Version 3.2.0.
First, I want to disable email notifications and am wondering if there is code I should put into the functions.php of a child theme or if unchecking the situation in an email template on BuddyPress will be sufficient in not having notifications sent due to such sitauations as mentions and replies.
Also, I want to disable activation emails and allow my users to be auto-approved. Can anyone tell me the best way to accomplish this?
I appreciate any assistance that you may be able to provide me.
Umm…It’s difficult.
This time I solved it as follows.
(function($){
var url = location.href
var urlSplit_notifications = url.split('/')[5];
if( urlSplit_notifications == 'notifications' ){
const target = document.getElementById("notifications-user-list");
const observer = new MutationObserver(records => {
alert('completed!');
});
const options = {
childList: true
};
observer.observe(target, options);
let shouldStopObserving = false;
if(shouldStopObserving){
observer.disconnect();
}
}
})(jQuery);
I really appreciate your help in resolving the problem.
See you whenever.
Hi, i have problem with this issue
I have WPForo and BuddyPress (but issue was same with bbpress) And if somebody reply on topic when i have subcribion, i have in notification menu blank title. Only Date and time send and action menu. In my Database in wp_bp_notitications is
id 13677
user_id 3
item_id 394
secondary_item_id 49
component_name community
component_action wpforo_new_reply
date_notified 2018-09-24 13:48:17
is_new 1
Hi,
Thanks for the reply.
I have installed poll plugin. Once admin will create a poll, it should be display notification alert for the users.
Not only about the poll. If i create events, breaking news and upcoming events etc.
You can register and login here,
Login Page
Once login, you can see the right sidebar. Whatever i have update or create from right sidebar.
The notification alert should be display in top right with “bell” icon.
Hi Everyone,
I have upgraded to BuddyPress: 3.1.0 and now i can’t seem to access messages and i am using Thrive Nouveau Child theme.
Browser Developer Browser error
JQMIGRATE: Migrate is installed, version 1.4.1
http://www.google-analytics.com/analytics.js:1 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
underscore.min.js?ver=1.8.3:5 Uncaught SyntaxError: Unexpected token ;
at new Function (<anonymous>)
System Info
// Generated by the Send System Info Plugin //
Multisite: No
WordPress Version: 4.9.8
Permalink Structure: /%postname%/
Active Theme: Thrive Nouveau Child
PHP Version: 7.2.9
MySQL Version: 5.6.40
Web Server Info: Apache
WordPress Memory Limit: 64MB
PHP Safe Mode: No
PHP Memory Limit: 256M
PHP Upload Max Size: 1000M
PHP Post Max Size: 1000M
PHP Upload Max Filesize: 1000M
PHP Time Limit: 600
PHP Max Input Vars: 10000
PHP Arg Separator: &
PHP Allow URL File Open: No
WP_DEBUG: Disabled
WP Remote Post: wp_remote_post() works
Session: Enabled
Session Name: PHPSESSID
Cookie Path: /
Save Path: /var/cpanel/php/sessions/ea-php72
Use Cookies: On
Use Only Cookies: On
DISPLAY ERRORS: N/A
FSOCKOPEN: Your server supports fsockopen.
cURL: Your server supports cURL.
SOAP Client: Your server has the SOAP Client enabled.
SUHOSIN: Your server does not have SUHOSIN installed.
ACTIVE PLUGINS:
404 to 301: 3.0.1
Absolutely Glamorous Custom Admin: 6.4.1
bbP private groups: 3.6.7
bbPress: 2.5.14
BP Block Users: 1.0.2
BP Local Avatars: 2.2
BP Simple Front End Post: 1.3.4
BuddyBlog: 1.3.2
BuddyKit: 0.0.3
BuddyPress: 3.1.0
BuddyPress Clear Notifications: 1.0.4
BuddyPress Docs: 2.1.0
BuddyPress Global Search: 1.1.9
BuddyPress Security Check: 3.2.2
BuddyPress User To-Do List: 1.0.4
GA Google Analytics: 20180828
GD bbPress Toolbox Pro: 5.2.1
GDPR: 2.1.0
Gears: 4.1.9
Gravity Forms: 2.3.2
Hide Admin Bar From Front End: 1.0.0
Image Upload for BBPress: 1.1.15
Insert Headers and Footers: 1.4.3
Invite Anyone: 1.3.20
iThemes Security Pro: 5.4.8
Kirki Toolkit: 3.0.33
MediaPress: 1.4.2
MediaPress – Downloadable Media: 1.0.3
Menu Icons: 0.11.2
Nifty Menu Options: 1.0.1
Really Simple SSL: 3.0.5
reSmush.it Image Optimizer: 0.1.16
Restricted Site Access: 7.0.1
s2Member Framework: 170722
SeedProd Coming Soon Page Pro: 5.10.8
Send System Info: 1.3
Slider Revolution: 5.4.7.3
SSL Insecure Content Fixer: 2.7.0
TaskBreaker – Group Project Management: 1.5.1
The Events Calendar: 4.6.23
The Events Calendar PRO: 4.4.30.1
Users Insights: 3.6.5
WP-Polls: 2.73.8
WPBakery Page Builder: 5.5.4
WP Mail SMTP: 1.3.3
WP Nag Hide: 1.0
WPS Hide Login: 1.4.3
Yoast SEO: 8.2
YouTube Live: 1.7.10
Thanks
Rockforduk