Hooks & Filters

Get Started

Hooks & Filters

Complete reference of actions and filters available in BuddyPress Member Reviews.

Actions

Review Lifecycle

buprbeforesave_review

Fires before a review is saved to the database. Use this to validate or modify data before insertion.

Location: includes/bupr-ajax.php

Example:

add_action( 'bupr_before_save_review', function() {
    // Perform custom validation before review is saved
    if ( ! current_user_can( 'publish_posts' ) ) {
        wp_send_json_error( 'You do not have permission to submit reviews.' );
    }
} );

buprmemberreviewafterreview_insert

Fires after a new review is created.

Parameters:

ParameterTypeDescription
$review_idintThe review post ID
$member_idintThe reviewed member’s user ID

Example:

add_action( 'bupr_member_review_after_review_insert', function( $review_id, $member_id ) {
    // Send custom notification
    $reviewer = wp_get_current_user();
    $member = get_userdata( $member_id );

    wp_mail(
        $member->user_email,
        'New Review Received',
        sprintf( '%s reviewed you.', $reviewer->display_name )
    );
}, 10, 2 );

buprsentreview_notification

Fires after review notification is sent.

Parameters:

ParameterTypeDescription
$member_idintThe reviewed member’s user ID
$review_idintThe review post ID

Example:

add_action( 'bupr_sent_review_notification', function( $member_id, $review_id ) {
    // Log notification in custom system
    error_log( sprintf( 'Review notification sent: User %d, Review %d', $member_id, $review_id ) );
}, 10, 2 );

buprownerreply_added

Fires after a profile owner submits a reply to a review.

Location: includes/bupr-ajax.php

Example:

add_action( 'bupr_owner_reply_added', function() {
    // Notify the original reviewer that the profile owner replied
    error_log( 'Owner reply was added to a review.' );
} );

buprreviewflagged

Fires after a review is flagged/reported by a user.

Location: includes/bupr-ajax.php

Example:

add_action( 'bupr_review_flagged', function() {
    // Send alert to admin when a review is reported
    wp_mail(
        get_option( 'admin_email' ),
        'Review Flagged',
        'A review has been flagged for moderation.'
    );
} );

buprrecalculationcompleted

Fires after batch rating recalculation finishes for all members.

Location: includes/bupr-general-functions.php

Example:

add_action( 'bupr_recalculation_completed', function() {
    // Clear custom caches after ratings are recalculated
    wp_cache_flush_group( 'bupr_ratings' );
    error_log( 'Rating recalculation completed.' );
} );

Template Hooks

buprbeforememberreviewlist

Fires before the review list on member profile.

Example:

add_action( 'bupr_before_member_review_list', function() {
    echo '<div class="custom-notice">Member reviews are moderated.</div>';
} );

bupraftermemberreviewlist

Fires after the review list on member profile.

Example:

add_action( 'bupr_after_member_review_list', function() {
    echo '<div class="review-disclaimer">Reviews reflect individual opinions.</div>';
} );

buprafterreview_content

Fires after individual review content. Used by Pro for skill tags.

Example:

add_action( 'bupr_after_review_content', function() {
    global $bupr_review;
    $custom_data = get_post_meta( $bupr_review->ID, 'custom_field', true );
    if ( $custom_data ) {
        echo '<div class="custom-data">' . esc_html( $custom_data ) . '</div>';
    }
} );

buprafterreview_date

Fires after review date display. Used by Pro for verified badges.

Example:

add_action( 'bupr_after_review_date', function() {
    global $bupr_review;
    if ( get_post_meta( $bupr_review->ID, 'custom_verified', true ) ) {
        echo '<span class="verified-badge">Verified Purchase</span>';
    }
} );

buprafterrating_fields

Fires after rating star fields in the review form. Used by the Pro addon to add additional form elements.

Location: includes/bupr-shortcodes.php

Example:

add_action( 'bupr_after_rating_fields', function() {
    echo '<div class="custom-field-group">';
    echo '<label for="custom_note">Additional Notes</label>';
    echo '<textarea name="custom_note" id="custom_note"></textarea>';
    echo '</div>';
} );

GamiPress Integration

gamipressbpmember_review

GamiPress integration trigger that fires when a review is submitted. Use this to award points or achievements through GamiPress.

Location: includes/bupr-ajax.php

Example:

// This hook is consumed by GamiPress automatically when the
// BuddyPress Member Reviews integration is active.
// No manual setup needed if GamiPress is installed.

Filters

Settings & Configuration

buprglobalsettings

Modify plugin settings at runtime. Used by Pro for mode switching.

Parameters:

ParameterTypeDescription
$buprarrayCurrent plugin settings

Returns: array Modified settings

Example:

add_filter( 'bupr_global_settings', function( $bupr ) {
    // Disable anonymous reviews programmatically
    $bupr['bupr_allow_anonymous_reviews'] = 'no';

    // Change review criteria
    $bupr['bupr_multi_criteria_ratings'] = array(
        'quality' => 'Quality',
        'service' => 'Service'
    );

    return $bupr;
} );

Profile Tab

buprshowprofilereviewtab

Control whether reviews tab appears on profile.

Parameters:

ParameterTypeDescription
$showboolWhether to show tab

Returns: bool Modified visibility

Example:

add_filter( 'bupr_show_profile_review_tab', function( $show ) {
    // Hide reviews tab for specific member types
    $member_type = bp_get_member_type( bp_displayed_user_id() );
    if ( $member_type === 'vendor' ) {
        return false;
    }
    return $show;
} );

buprreviewtab_name

Change the reviews tab label.

Parameters:

ParameterTypeDescription
$namestringCurrent tab name

Returns: string Modified tab name

Example:

add_filter( 'bupr_review_tab_name', function( $name ) {
    return 'Testimonials';
} );

buprprofilereviewsingulartab_name

Change the singular form of the reviews tab name (used when the tab count is 1).

Location: includes/bupr-general-functions.php

Parameters:

ParameterTypeDescription
$namestringSingular tab name

Returns: string Modified singular tab name

Example:

add_filter( 'bupr_profile_review_singular_tab_name', function( $name ) {
    return 'Testimonial';
} );

buprdefaultsubnav_slug

Change the default subnav slug for the reviews tab on BuddyPress profiles.

Location: includes/bupr-general-functions.php

Parameters:

ParameterTypeDescription
$slugstringDefault subnav slug

Returns: string Modified subnav slug

Example:

add_filter( 'bupr_default_subnav_slug', function( $slug ) {
    return 'my-custom-subnav';
} );

Activity Stream

buprallowactivity_posting

Enable or disable activity stream posts for reviews.

Parameters:

ParameterTypeDescription
$allowboolWhether to allow activity posts

Returns: bool Modified permission

Example:

add_filter( 'bupr_allow_activity_posting', function( $allow ) {
    // Disable activity posts during business hours
    $hour = (int) date( 'H' );
    if ( $hour >= 9 && $hour <= 17 ) {
        return false;
    }
    return $allow;
} );

buprmemberreviewactivityaction

Customize the activity stream action text displayed for review activities.

Location: includes/bupr-filters.php

Parameters:

ParameterTypeDescription
$actionstringActivity action text

Returns: string Modified action text

Example:

add_filter( 'bupr_member_review_activity_action', function( $action ) {
    // Replace default activity text with custom wording
    return str_replace( 'posted a review', 'shared feedback about', $action );
} );

Anonymous Reviews

buprchangeuser_link

Modify the user link for anonymous reviews displayed in the activity stream.

Location: includes/bupr-filters.php

Parameters:

ParameterTypeDescription
$linkstringUser profile link HTML

Returns: string Modified link HTML

Example:

add_filter( 'bupr_change_user_link', function( $link ) {
    return '<span class="anonymous-label">Anonymous Member</span>';
} );

buprchangeavatar_image

Modify the avatar image for anonymous reviews in the activity stream.

Location: includes/bupr-filters.php

Parameters:

ParameterTypeDescription
$avatarstringAvatar image HTML

Returns: string Modified avatar HTML

Example:

add_filter( 'bupr_change_avatar_image', function( $avatar ) {
    // Use a custom anonymous avatar image
    return '<img src="' . esc_url( get_stylesheet_directory_uri() . '/images/anon-avatar.png' ) . '" class="avatar" width="50" height="50" />';
} );

buprdefaultavatar_size

Change the avatar size used for anonymous review avatars. Default is 50.

Location: includes/bupr-filters.php

Parameters:

ParameterTypeDescription
$sizeintAvatar size in pixels (default: 50)

Returns: int Modified avatar size

Example:

add_filter( 'bupr_default_avatar_size', function( $size ) {
    return 80;
} );

buprchangedefault_avatar

Change the default avatar type used for anonymous reviews. Default is 'mystery'.

Location: includes/bupr-filters.php

Parameters:

ParameterTypeDescription
$typestringAvatar type (default: ‘mystery’)

Returns: string Modified avatar type

Example:

add_filter( 'bupr_change_default_avatar', function( $type ) {
    return 'blank'; // Use a blank avatar instead of mystery person
} );

Review Display

bupraggregaterating

Modify the calculated aggregate (average) rating for a member. Useful for weighting or adjusting ratings.

Location: includes/bupr-general-functions.php

Parameters:

ParameterTypeDescription
$ratingfloatCalculated aggregate rating

Returns: float Modified aggregate rating

Example:

add_filter( 'bupr_aggregate_rating', function( $rating ) {
    // Round to nearest half star
    return round( $rating * 2 ) / 2;
} );

buprreviewername_html

Modify the reviewer name HTML displayed in the review list.

Location: includes/templates/bupr-reviews-tab-template.php

Parameters:

ParameterTypeDescription
$htmlstringReviewer name HTML

Returns: string Modified HTML

Example:

add_filter( 'bupr_reviewer_name_html', function( $html ) {
    // Add a custom badge next to reviewer names
    return $html . ' <span class="reviewer-badge">Member</span>';
} );

Shortcode & Widget

buprshortcodeoutput

Modify shortcode output HTML.

Parameters:

ParameterTypeDescription
$htmlstringShortcode output HTML
$attsarrayShortcode attributes

Returns: string Modified HTML

Example:

add_filter( 'bupr_shortcode_output', function( $html, $atts ) {
    // Wrap shortcode output in custom container
    return '<div class="custom-reviews-wrapper">' . $html . '</div>';
}, 10, 2 );

buprdisplaytopmembersshortcode_atts

Modify the default shortcode attributes for [buprdisplaytop_members].

Location: includes/bupr-shortcodes.php

Parameters:

ParameterTypeDescription
$attsarrayShortcode default attributes

Returns: array Modified attributes

Example:

add_filter( 'bupr_display_top_members_shortcode_atts', function( $atts ) {
    // Change default number of members shown
    $atts['count'] = 10;
    return $atts;
} );

buprshortcodeshow_stars

Control whether star ratings are displayed in shortcode output.

Location: includes/bupr-shortcodes.php

Parameters:

ParameterTypeDescription
$showboolWhether to show stars

Returns: bool Modified visibility

Example:

add_filter( 'bupr_shortcode_show_stars', function( $show ) {
    // Hide stars on specific pages
    if ( is_page( 'testimonials' ) ) {
        return false;
    }
    return $show;
} );

bupritemtype_label

Change the “reviews” label text used in shortcode and widget output.

Location: includes/bupr-shortcodes.php

Parameters:

ParameterTypeDescription
$labelstringLabel text (default: ‘reviews’)

Returns: string Modified label

Example:

add_filter( 'bupr_item_type_label', function( $label ) {
    return 'testimonials';
} );

buprwidgetshow_stars

Control whether star ratings are displayed in widget output (both Member Rating and Display Review widgets).

Location: admin/widget/member-rating.php, admin/widget/display-review.php

Parameters:

ParameterTypeDescription
$showboolWhether to show stars

Returns: bool Modified visibility

Example:

add_filter( 'bupr_widget_show_stars', function( $show ) {
    return false; // Hide stars in all review widgets
} );

buprmemberquery_args

Modify the WPUserQuery arguments used to populate the member dropdown in the review form.

Location: includes/bupr-shortcodes.php

Parameters:

ParameterTypeDescription
$argsarrayWPUserQuery arguments

Returns: array Modified query arguments

Example:

add_filter( 'bupr_member_query_args', function( $args ) {
    // Only show members with a specific role in the dropdown
    $args['role'] = 'vendor';
    return $args;
} );

buprmemberlist

Modify the member list array used for the review form dropdown after the query runs.

Location: includes/bupr-shortcodes.php

Parameters:

ParameterTypeDescription
$membersarrayArray of user objects

Returns: array Modified member list

Example:

add_filter( 'bupr_member_list', function( $members ) {
    // Remove current user from the dropdown
    return array_filter( $members, function( $member ) {
        return $member->ID !== get_current_user_id();
    } );
} );

Asset Loading

buprshouldload_assets

Control when plugin CSS and JS assets are loaded on the frontend. Return false to prevent loading on the current page.

Location: includes/bupr-scripts.php

Parameters:

ParameterTypeDescription
$loadboolWhether to load assets (default: true)

Returns: bool Modified loading decision

Example:

add_filter( 'bupr_should_load_assets', function( $load ) {
    // Only load assets on BuddyPress pages and pages with review shortcodes
    if ( ! is_buddypress() && ! has_shortcode( get_post()->post_content ?? '', 'bupr_display_top_members' ) ) {
        return false;
    }
    return $load;
} );

Form & Edit

buprreviewform_fields

Note: This is a Pro-only hook (added by the Pro addon).

Modify review form fields.

Parameters:

ParameterTypeDescription
$fieldsarrayForm fields configuration

Returns: array Modified fields

Example:

add_filter( 'bupr_review_form_fields', function( $fields ) {
    // Add custom field
    $fields['custom_field'] = array(
        'label'    => 'Project Type',
        'type'     => 'select',
        'options'  => array(
            'web' => 'Web Development',
            'app' => 'App Development'
        ),
        'required' => true
    );
    return $fields;
} );

buprreviewtemplate

Note: This is a Pro-only hook (added by the Pro addon).

Use custom review template file.

Parameters:

ParameterTypeDescription
$templatestringTemplate file path

Returns: string Modified template path

Example:

add_filter( 'bupr_review_template', function( $template ) {
    // Use custom template for specific member types
    $member_type = bp_get_member_type( bp_displayed_user_id() );
    if ( $member_type === 'vendor' ) {
        return get_stylesheet_directory() . '/vendor-reviews.php';
    }
    return $template;
} );

bupreditreviewextrafields

Add custom fields to edit review form.

Parameters:

ParameterTypeDescription
$htmlstringCurrent extra fields HTML
$review_idintReview post ID

Returns: string Modified HTML

Example:

add_filter( 'bupr_edit_review_extra_fields', function( $html, $review_id ) {
    $custom_value = get_post_meta( $review_id, 'custom_field', true );

    $html .= '<div class="form-group">';
    $html .= '<label>Custom Field</label>';
    $html .= '<input type="text" name="custom_field" value="' . esc_attr( $custom_value ) . '">';
    $html .= '</div>';

    return $html;
}, 10, 2 );

Hook Priority

All plugin hooks use default priority (10). To execute your code before plugin logic, use priority less than 10. To execute after, use priority greater than 10.

Example:

// Run before plugin
add_filter( 'bupr_global_settings', 'my_function', 5 );

// Run after plugin
add_action( 'bupr_member_review_after_review_insert', 'my_function', 15 );

Related Documentation

Last updated: February 13, 2026