Hooks and Filters
BuddyLists exposes filters on nearly every data function and a set of action hooks in its templates. Names below are taken from the plugin source.
Data filters
Section titled “Data filters”Each of these filters the return value of the matching function.
| Filter | Used for |
|---|---|
buddylists_list_count |
Total list count for a user. |
buddylists_widget_member_ceiling |
How many members the sidebar widgets consider on one list. Default 500; the newest memberships win when it bites. Receives the list ID. |
buddylists_active_member_window_days |
How many days back the Active Members widget counts a member as active. Default 30. Receives the list ID. |
buddylists_activity_member_ceiling |
Caps how many people a list’s activity feed draws from. Default 0, meaning everyone on the list. Receives the list ID. |
buddylists_people_per_page |
People shown per page on the Members and Followers views. Default 20. |
buddylists_image_max_bytes |
Largest cover or icon in bytes. Default 5 MB, and never above the server’s upload limit. |
buddylists_reserved_slugs |
Addresses refused for the Web address setting. Receives the list built from your site’s own pages and bases. |
buddylists_get_followers_count |
Follower count for a list. |
buddylists_next_button_behavior |
Options for the create and edit window’s save button. Only create_list_on_next, validation_required and redirect_on_error are read. |
buddylists_list_insert |
Result of inserting a list. |
buddylists_insert_members |
Result of adding a member to a list. |
buddylists_delete_members |
Result of removing a member. |
buddylists_list_update |
Result of updating a list. |
buddylists_fetch_list_data_by_id |
List data fetched by ID. |
buddylists_fetch_member_data_by_list_id |
Members of a list. |
buddylists_fetch_member_count |
Member count for a list. |
buddylists_fetch_list_all_data |
Full list payload. |
buddylists_fetch_list_by_slug |
List looked up by slug. |
buddylists_fetch_list |
List lookup. |
buddylists_list_link |
Public URL of a list. |
buddylists_get_suggestions |
Suggested members for a user. |
buddylists_delete_list_data |
Result of deleting a list. |
buddylists_delete_all_members |
Result of clearing a list’s members. |
buddylists_get_paginated_lists |
Paginated lists for a user. |
buddylists_get_user_followers_count |
Follower count for a user. |
buddylists_get_user_following_count |
Following count for a user. |
Settings filters
Section titled “Settings filters”These filter the resolved settings arrays, letting you override any stored value at runtime.
buddylists_general_settingsbuddylists_visibility_settingsbuddylists_activity_settings(the two options now stored with the Visibility settings)buddylists_notification_settingsbuddylists_color_settingsbuddylists_admin_tabsadds, removes or reorders the sidebar screens on the admin page.buddylists_editable_roles
Permission filters
Section titled “Permission filters”buddylists_create_list_permissionfilters whether the current user may create lists.buddylists_can_editfilters whether the current user may edit a given list. Kept for themes that hook it. The server decides withbuddylists_user_can_manage_list().buddylists_user_can_manage_listfilters whether a user may manage a list. Receives the result, the list ID and the user ID. The AJAX endpoints and templates both use it.buddylists_is_relevant_activiesfilters whether list activity is relevant on the site.buddylists_is_friendsfilters the result of thebuddylists_is_friends()helper. BuddyLists itself no longer calls that helper, so the filter only affects your own code that does.
Notification filters
Section titled “Notification filters”buddylists_send_bp_notification_usertoggles the BuddyPress notification when a member is added or removed. The value it receives follows the Added to a list or Removed from a list setting. The other arguments are the action (“added” or “removed”) and the member ID.buddylists_send_email_notification_usertoggles the email notification. The value it receives follows the Email members setting, which is off by default.buddylists_email_messagefilters the email message text. Receives the message, the list, the action and the member ID.
Template filter
Section titled “Template filter”buddylists_locate_templatefilters the resolved template path. See Template Overrides.
Action hooks
Section titled “Action hooks”Lifecycle actions:
| Action | Arguments |
|---|---|
buddylists_list_created |
List ID, owner user ID. |
buddylists_list_updated |
List ID, user ID. |
buddylists_list_deleted |
List ID. |
buddylists_member_added |
List ID, member ID. |
buddylists_member_removed |
List ID, member ID. |
Template actions you can attach to:
buddylists_before_next_buttonandbuddylists_after_next_buttonaround the Create list button in the create and edit window.buddylists_after_visibility_fieldafter the Make Private field in that window.buddylist_before_single_list_banner,buddylist_single_list_bannerandbuddylist_after_single_list_bannerin the single list template.buddylists_after_follow_button(receives the list ID) after the Follow List button.buddylist_after_direct_message_modalin the single list template. The message window it was named after no longer exists, so the action fires with nothing before it.
Removed hooks
Section titled “Removed hooks”buddylist-user-info-popupis gone. The hover preview over member names was removed, and nothing fires this action any more.

