bp_notifications_add_notification()
is used to add a notification. For example:
if ( bp_is_active( 'notifications' ) ) {
bp_notifications_add_notification( array(
'user_id' => $user_id,
'item_id' => $item_id,
'secondary_item_id' => $secondary_item_id,
'component_name' => $component_name,
'component_action' => $component_action,
'date_notified' => bp_core_current_time(),
'is_new' => 1,
) );
}
See here for more info: https://codex.buddypress.org/developer/function-examples/bp_notifications_add_notification/
yeah thanks. sorry i don’t know the Php (just a little). im webdesigner.
so its possible to add notification page ? for all users admin/subscriber.
(there are no anonymous users in my intranet)
thanks
and i must write it in ‘function.php’ in childtheme
or directly in the file buddypress? (not erase in update ?)
@henrywright
do you have another exemple. to make page notif ?
I try that, and many other setting… nothing appears.
if ( bp_is_active( 'notifications' ) ) {
bp_notifications_add_notification( array(
'all' => $user_id,
'pages' => $item_id,
'pages/ edit' => $secondary_item_id,
'component_name' => $component_name,
'component_action' => $component_action,
'date_notified' => bp_core_current_time(),
'is_new' => 1,
) );
}
thank you
victord34
@victord34
10 years, 3 months ago
hello (im french),
even if the plugin would be paying I take..
i would like to make a drop down notification in wp-adminbar with numb (like buddypress.org)
but I’d like to change notifications. exemple : (new page ‘cherry’ was created; page ‘chocolat’ was edit) only PAGES not articles or comment.
its for a intranet, I want the user to be aware of new pages upload.
i think @bphelp was talking of this subject in other topic.