Skip to content

Hooks start with bpquotes_ unless noted. Add your callbacks in a small plugin or your theme’s functions.php.

Quote type values used by the plugin: quotescolor, quotesimg, quotesgradient, quotespreset, quotesanimated.


Fires after a quote is saved and written to the activity log. Every other posting action below starts from this one.

do_action( 'bpquotes_after_quote_posted', $user_id, $activity_id, $quote_type, $group_id );
Parameter Type Description
$user_id int Member who posted
$activity_id int BuddyPress activity ID
$quote_type string One of the quote type values above
$group_id int Group ID, or 0 outside groups

Fires right after bpquotes_after_quote_posted with a data array. The myCred points and the trigger actions below hang off it.

do_action( 'bpquotes_quote_posted', $user_id, $activity_id, $quote_data );

$quote_data is an array with the keys type (quote type), group_id and activity_id.

These fire from bpquotes_quote_posted with ( $user_id, $activity_id, $quote_data ). GamiPress and BadgeOS listen to them.

Action When
bpquotes_post_quote Every quote
bpquotes_post_image_quote Quote type is quotesimg
bpquotes_post_color_quote Quote type is quotescolor
bpquotes_post_group_quote The quote was posted in a group

These fire from bpquotes_after_quote_posted.

Action Arguments When
bpquotes_user_posted_quote $user_id, $activity_id, $quote_type, $group_id Every quote
bpquotes_user_posted_image_quote $user_id, $activity_id, $group_id Quote type is quotesimg
bpquotes_user_posted_color_quote $user_id, $activity_id, $group_id Quote type is quotescolor
bpquotes_user_posted_group_quote $user_id, $activity_id, $quote_type, $group_id Group is set

Gradient, preset and animated quotes fire the “every quote” and group actions only.

Fires after the quote background is saved to the activity meta.

do_action( 'bpquotes_update_quotes_activity_meta', $content, $user_id, $activity_id, $g_activity_id );

Fires after a Youzify post saves its quote background.

do_action( 'bpquotes_update_yzea_activity_quotes', $content, $activity_id );

bpquotes_activity_post_form_options_before and _after

Section titled “bpquotes_activity_post_form_options_before and _after”

Fire before and after the quote icon is output in the post box. No arguments.


Filters the picker HTML before it is printed. The output passes through wp_kses(), so only allowed tags survive.

apply_filters( 'bpquotes_activity_post_form_option_panel', $html, $settings );

Filters the activity body after the quote wrapper is added.

apply_filters( 'bpquotes_update_quotes_activity_content', $content, $activity );

Filters the HTML of the [bp_quotes] shortcode.

apply_filters( 'bpquotes_rest_api_shortcode', $html, $atts, $activity_data );

Filters the BuddyPress activity REST response after the plugin adds a bp_quotes field (the quote meta, or empty).

apply_filters( 'bpquotes_activity_data_embed_rest_api', $response, $request, $activity );

Runs on every BPQuote_Settings::get() call. Return a different value to override a setting at run time.

add_filter( 'bpquotes_get_setting', function ( $value, $key, $group ) {
return ( 'digest_enabled' === $key ) ? 'no' : $value; // Never send digests on staging.
}, 10, 3 );

$group is general (option bpquotes_gnrl_settings) or integrations (option bpquotes_mycred_settings, which also holds AI and digest settings).

bpquotes_sanitize_settings and bpquotes_sanitize_integration_settings

Section titled “bpquotes_sanitize_settings and bpquotes_sanitize_integration_settings”

Filter the sanitized settings array before it is saved. Both receive ( $sanitized, $input ). Keys you add must be re-added here or the sanitizer drops them.

add_filter( 'bpquotes_sanitize_settings', function ( $sanitized, $input ) {
if ( isset( $input['my_key'] ) ) {
$sanitized['my_key'] = sanitize_text_field( $input['my_key'] );
}
return $sanitized;
}, 10, 2 );

Turns a preset ID into a background spec. The plugin’s own preset store answers at priority 10; add yours earlier to override.

add_filter( 'bpquotes_resolve_preset', function ( $spec, $id ) {
if ( 42 === (int) $id ) {
return array( 'type' => 'solid', 'value' => '#ff0000', 'text_color' => '#ffffff' );
}
return $spec;
}, 5, 2 );

A spec has type (solid, image or gradient) plus value, or stops and angle for gradients, and an optional text_color. Return null for an unknown preset.

Filters the text color picked for a background.

add_filter( 'bpquotes_background_text_color', function ( $color, $spec ) {
return ( 'image' === ( $spec['type'] ?? '' ) ) ? '#ffffff' : $color;
}, 10, 2 );

$spec is the normalized spec array described above.

Filters the share links. The array maps a target ID to a ready-made URL.

add_filter( 'bpquotes_share_targets', function ( $links, $png_url, $page_url, $text ) {
unset( $links['pinterest'] );
$links['mastodon'] = 'https://mastodon.social/share?text=' . rawurlencode( $text . ' ' . $page_url );
return $links;
}, 10, 4 );

The share window labels the five built-in IDs and shows any other ID with a capitalized name.

Filters the watermark printed on shared pictures.

add_filter( 'bpquotes_watermark_text', function ( $text, $activity ) {
return $text . ' | example.com';
}, 10, 2 );

$activity can be null when the cache key is built, so check it before use.

Filters the map of locale to font stack and Google Fonts script set.

add_filter( 'bpquotes_fonts_by_locale', function ( $map ) {
$map['vi'] = array( 'stack' => '"Noto Sans"', 'subset' => 'vietnamese' );
return $map;
} );
Filter Arguments Purpose
bpquotes_digest_query_args $args with limit, days, order Change how many quotes and how many days back
bpquotes_digest_landing_url $url, $page_id Change the email button link
bpquotes_ai_request_timeout $seconds (default 30) Change the AI request timeout

Filters the array returned by bpquotes_get_statistics(), which the Overview tab also uses: total_quotes, image_quotes, color_quotes, users_using_quotes. The second argument is the $args passed to the helper (date_from, date_to).

Return true to add a Quotes tab to member profiles. It is off by default.

add_filter( 'bpquotes_enable_profile_stats_tab', '__return_true' );
Filter Purpose
bpquote_admin_tabs Add or change admin tabs. Each tab needs label, icon and group (main, settings or account).
bpquote_admin_view_map Map a tab slug to a view file name under includes/admin/views/
bpquote_admin_settings_group_map Map a tab slug to its Settings API option group

Function Returns
bpquotes_is_quoted_activity( $activity_id ) true when the activity has a quote background
bpquotes_get_quote_class( $activity_id ) The quote type, for example quotesimg
bpquotes_get_quote_bg_value( $activity_id ) The background value (hex, image URL, gradient, or ID)
bpquotes_get_quote_bg_inverted_value( $activity_id ) The text color
bpquotes_activity_has_quote( $activity_id ) true when the has_quote_background meta is yes
bpquotes_get_activities_with_quotes( $args ) bp_activity_get() result limited to quote posts
bpquotes_get_activities_by_quote_type( $type, $args ) bp_activity_get() result for one quote type
bpquotes_get_statistics() Quote counts for the last 30 days

The first four helpers run their value through these filters: alter_is_quoted_activity, alter_bpquotes_get_quote_class, alter_bpquotes_get_quote_value and alter_bpquotes_get_quote_inverted_value. Each receives one argument, the value.