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.
Thanks for your response however i cant find the members/single.notification/notification-loop.php file in my them or plugins, not sure if i’m looking in completely the wrong place
Ah ok,
So first of all you need a child theme, there’s plenty on plugins available that wil set one up for you.
Next you need to know which BP Template is being used by going to Settings>BuddyPress>Options, here you will see it’s either set to Legacy or Nouveau.
Next create a directory in your childtheme called buddypress/members/single/notifications
Next copy the file plugins/buddypress/bp-templates/(bp-nouveau or bp-legacy)/buddypress/members/single/notifications/notifications-loop.php
to the notifications you created in your childtheme.
You can then edit this file to add your changes. in here you will find the function call I mentioned for you to add the args to.
brilliant, that is so helpful, thank you i will give it a go
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 ); ?>
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>
Ah yes, slight correction required:
<?php $args = array(
'links' => array(
bp_get_the_notification_mark_link( bp_displayed_user_id() )
)
);?>