Skip to content

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.

Each of these filters the return value of the matching function.

Filter Used for
buddylists_list_count Total list count for a user.
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.

These filter the resolved settings arrays, letting you override any stored value at runtime.

  • buddylists_general_settings
  • buddylists_visibility_settings
  • buddylists_activity_settings
  • buddylists_notification_settings
  • buddylists_color_settings
  • buddylists_editable_roles
  • buddylists_create_list_permission filters whether the current user may create lists.
  • buddylists_can_edit filters whether the current user may edit a given list.
  • buddylists_is_relevant_activies filters whether list activity is relevant on the site.
  • buddylists_is_friends filters the friend check used by edit permissions.
  • buddylists_send_bp_notification_user toggles the BuddyPress notification when a member is added or removed. Receives the action (“added” or “removed”) and the member ID.
  • buddylists_send_email_notification_user toggles the email notification. Defaults to false.
  • buddylists_email_message filters the notification message text.
  • buddylists_locate_template filters the resolved template path. See Template Overrides.

Template action hooks you can attach to:

  • buddylist-user-info-popup (receives the user ID) inside the profile preview popup.
  • buddylists_before_next_button and buddylists_after_next_button in the list creation template.
  • buddylist_before_single_list_banner, buddylist_single_list_banner, buddylist_after_single_list_banner and buddylist_after_direct_message_modal in the single list template.