Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion about bp_example_format_notifications #10

Open
MrVibe opened this issue Dec 3, 2014 · 1 comment
Open

Confusion about bp_example_format_notifications #10

MrVibe opened this issue Dec 3, 2014 · 1 comment

Comments

@MrVibe
Copy link

MrVibe commented Dec 3, 2014

There is absolutely no information about how notifications are added in the BuddyPress system. The function in the skeleton which adds notifications bp_example_format_notifications is not connected to any action or filter. It is also not calling the bp_notifications_add_notification function which is responsive for adding notifications. Can someone please shed some information about how the mysterious notifications work in BuddyPress ?

@imath
Copy link
Collaborator

imath commented Dec 3, 2014

Hi MrVibe,

The format notifications callback is set into the component's loader. We've been working on a new branch (1.7) and you can browse this code :
https://github.com/boonebgorges/buddypress-skeleton-component/blob/1.7/includes/bp-example-loader.php#L276

It means when creating your component's loader, you need to create a setup_globals() function to register your component globals (root slug, custom tables if any, search_string... and the notification_callback)

Then in https://github.com/boonebgorges/buddypress-skeleton-component/blob/1.7/includes/bp-example-notifications.php#L111 you will find the bp_example_format_notifications() that is used to display the notifications into the WP Admin Bar and the user notification screens (read/unread).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants