Hi,
Can you please help me with sipped code to :
Auto delete “already red” buddypress notificationMost people lazy and don’t really take care of delete these, my web used shared hosting, i would like make this clear automatice right the time user read notification
Thanks
Hi Julia,
Please add the following code to your bp-custom.php/** * Delete Read notifications. */ function buddydev_clear_read_notifications() { if( ! bp_is_my_profile() ) { return ; } BP_Notifications_Notification::delete( array( 'user_id' => get_current_user_id(), 'is_new' => 0, ) ); } add_action( 'bp_notifications_screen_unread', 'buddydev_clear_read_notifications' );
That will do it.
Regards
BrajeshHi,
1) It worked on case click on “read” button. It don’t work with click on view title link.
2) Button:
Read | DeleteI found “|” classs is #text, but i tried to display:none
==> But it don’t work. How do i success delete “|”Thanks
Hello Julia,
Please use the following code in your bp-custom.php.
function buddydev_remove_separator( $retval, $r ) { $retval = str_replace( ' | ', ' ', $retval ); return $retval; } add_filter( 'bp_get_the_notification_action_links', 'buddydev_remove_separator', 10, 2 );
Thank You
RaviHi Julia,
My code deletes all read notifications when you are on notifications page(unread). It does not do anything else.All coded worked as support.
Can you please give a snipped code
Make “Delete” button of “bunk action” in Notifications checked by defaul?Thanks
Sorry, That would need js and I will not recommend it doing here. I don’t think checking by default does any good too and the time spent on providing code is not justified.
Regards
Brajesh
You must be logged in to reply to this topic.