I need some custom notifications in my website. I have my code bellow, all work correctly, notification is added into database and displayed at the recipient, but without notification text

How i can fix this?
Thank you
function custom_filter_notifications_get_registered_components( $component_names = array() ) {
// Force $component_names to be an array
if ( ! is_array( $component_names ) ) {
$component_names = array();
}
// Add 'custom' component to registered components array
array_push( $component_names, 'custom' );
// Return component's with 'custom' appended
return $component_names;
}
add_filter( 'bp_notifications_get_registered_components', 'custom_filter_notifications_get_registered_components' );
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 notification";
$custom_link = "domain.com";
$custom_text = "You have new 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, $custom_text, $custom_title );
}
return $return;
}
}
add_filter( 'bp_notifications_get_notifications_for_user', 'custom_format_buddypress_notifications', 10, 5 );
function bp_custom_add_notification( $receiver_user_id, $initiator ) {
//$post = get_post( $comment_object->comment_post_ID );
//$author_id = $post->post_author;
bp_notifications_add_notification( array(
'user_id' => $receiver_user_id,
'item_id' => $initiator,
'secondary_item_id' => $initiator,
'component_name' => 'custom',
'component_action' => 'custom_action',
'date_notified' => bp_core_current_time(),
'is_new' => 1,
) );
}
add_action( 'wp_insert_custom_notification', 'bp_custom_add_notification', 99, 2 );
@sitesfromash All the fields you keep in base group, those will be visible at registration page
For details you can check https://codex.buddypress.org/getting-started/guides/modifying-the-registration-form/
It’s simple to do.
Create and publish a page entitled ‘Regional Groups’.
Go to the BuddyPress Settings: yoursite.com/wp-admin/admin.php?page=bp-page-settings
For the User Groups setting, chose ‘Regional Groups’ from the drop down.
Then click ‘Save Settings’.
BuddyPress will use the Regional Groups page.
And you can use the Groups page for whatever you want.
Dear,
I tried but it didn’t work. I made a bp-custom.php map in: wp-content/plugins/bp-custom.php –> In the map bp-custom.php i placed a file bp-custom.php
I used notedpadd ++ as a editor to place the code you give me and copied it to my server. Once installed, i can’t enter my site. It gives an error:
Warning: require …
Fatal error: require(): Failed opening .. class-buddypress.php on line 226
This looks strange, cause the code filled in notepadd ++ goes only to line 11.
I filled it in as:
<?php
function bp_activities_user_friends_scope( $retval ) {
if ( bp_is_activity_directory() ) {
$retval[‘scope’] = ‘friends’;
}
return $retval;
}
add_filter( ‘bp_after_has_activities_parse_args’, ‘bp_activities_user_friends_scope’ );
?>
did I do something wrong?
Big thank for youre help
Looks like that would be buddypress/groups/single/members-loop.php.
this line:
<?php if ( bp_group_has_members( bp_ajax_querystring( 'group_members' ) ) ) : ?>
Would be the one to change:
<?php if ( bp_group_has_members( bp_ajax_querystring( 'group_members' ) . '&type=alphabetical' ) ) : ?>
Hopefully that should work
There’s a plugin the converts a group to announce only, maybe that could be the basis of a fan page?
BuddyPress Announce Group
@hitesh4317 BuddyPress does not any inbuilt feature to display post listing at their profile. You might be using some 3rd party plugin.
BuddyPress does not manage what happens to posts when a user is deleted, I think that’s a WordPress function.
Fan Page or group rvert to fan page ?!
Is there any way to revert groups to fan pages or any plugin that can create a fan page for buddypress ?!
Anyone here? I have tried EVERYTHING! Running the tasks on Buddypress, eliminating the cache
I’m wondering if there was a way to have an occasional rss post show up the bp activity feed. (for example fox news) Has anyone done this? Thanks…Robb
If you are talking about activity posts…
The default behavior is NOT to remove the content, but to refuse to post it and show the error message and leave the content in the textbox.
Are you running some other code re moderation?
Anyhow…
Unfortunately, there are no hooks in the moderation functions.
So you would need to remove the hook that is added in buddypress\bp-activity\bp-activity-filters.php
add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
add_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2, 1 );
and replace it will a hook that leads to a custom function that does what you want.
@pratibhasvaksha You can check the following doc
Navigation API
@markorton93 BuddyPress Post activity section is plain input area without any text editor.
@oaz on localhost it might have issues
like this
Refused to display ‘https://buddypress.org/support/topic/not-embedding-in-groups/embed/#?secret=hteHTpJ8oj’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’.
but at a live site with https, it will fine for both profile and group activity.
eg you can check here https://dokan.wpbp.in/members/admin/
Hmmm… The OP was for default alphabetical listings for group members.
In that case, rather than the members-loop template, the template to overload is this ( assuming you are using the Legacy template pack ):
buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php
And the change would be:
<?php if ( bp_group_has_members( bp_ajax_querystring( 'group_members' ) . '&type=alphabetical' ) ) : ?>
So try overloading that template and make sure you adjust the placement of that template in your child theme.
afaik – It is not possible, at least not easily.
Members are not stored per site – regardless of whether BP is activated per site or globally.
And neither are BuddyPress activity items. “Recently Active” is handled via activity items.
WP multisite uses the usermeta database table to track which users have access to which sites.
You could write a custom widget that checks BP last_activity items and then filters it by the usermeta data.
Hi,
I have a multisite install with one main domain and 3 sub domains. I have buddypress activated locally on each site rather than network-wide. I’m using the recently active members widget on one of my pages of one sub domain, but I want it to show only users from that same sub domain and not users from across the whole network. Is this possible?
Both wordpress and buddypress are running on the latest version.
Thanks!
Hello there, I am running a WP wih BP, all updated to latest version.
From what I read on the codex, thre should be no issue with embedding photos in groups flow
Embeds
Well, I do have an issue with photos, they will not show a preview when I paste a link. (It works well with videos though). What can I do about this ?
Thanks
Hi everyone,
My friend and I are having issues with our Activation Email. While we are also sending emails by another plugin which is instant. We are using our own Host to send the emails.
Sometimes it gets sent straight away while some email providers it can take up to a day for them to get it.
Looked around and they also mostly are about Not Sending ours send just some are really late.
Does anyone else have this issue?
BuddyPress 4.1.0 – WordPress 5.0.3
Thanks.
Hello,
I am using the latest BuddyBress version (legacy template) and have disabled the activity stream. For security reasons I want to hide a member’s username wherever it is possible. Can someone please advice me how to hide the username in the autocomplete field? Please note the attached screenshot.
I found this thread, which probably shows a solution for my request, but unfortunately I have no coding skills and got stuck while trying to follow the steps.
Autocomplete shows both names
Many thanks

my website vikings.life WordPress 5.0.3 BuddyPress 4.1.0