BuddyX
Get BuddyX Pro

Filter Hooks Reference

Free theme

Every apply_filters() seam BuddyX 5.1.9 exposes, so you can transform theme data from a child theme or plugin without editing core theme files.


BuddyX fires 80 filter hooks. This page groups the theme-owned buddyx_* / bp_* filters by area, then lists the third-party (WooCommerce, WordPress core, rtMedia) filters that BuddyX re-applies inside its template overrides.

Requires PHP 8.1+. Every filter listed here is extracted from the theme source. Signatures occasionally change between minor releases, so verify before you ship:

# From the theme root, confirm a filter and its argument count:
grep -rn "apply_filters( 'buddyx_css_files'" inc/

Filter vs action. BuddyX prefers filters (data passes through, you transform it and return it) over actions (a bare event) wherever a customization point produces a value. Filters compose - many plugins can layer on one filter without stepping on each other. If you want a side effect at a point exposed only as a filter, run it inside the filter callback and return the value unchanged.

Customer using the theme? You do not need this page. Filters are for plugin authors and child-theme developers.


How to use a filter

Add your callback on after_setup_theme or later (most BuddyX filters fire during template rendering or wp_enqueue_scripts):

add_filter( 'buddyx_footer_copyright_text', function ( $text ) {
    return '© ' . date_i18n( 'Y' ) . ' My Company. All rights reserved.';
} );

Always return a value from a filter callback. Match the declared argument count with the 3rd/4th add_filter() arguments when you need more than the first value:

add_filter( 'buddyx_customizer_field_args', 'my_force_postmessage', 10, 2 );
function my_force_postmessage( $args, $wp_customize ) {
    // $args is the field config, $wp_customize is the manager instance.
    return $args;
}

Breadcrumb filters

Everything the breadcrumb trail builds passes through these. Defined in inc/class-buddyx-breadcrumbs.php.

Filter Args Applied at What it filters
buddyx_breadcrumb_trail_args 1 inc/class-buddyx-breadcrumbs.php:84 The full breadcrumb args array before the trail is built
buddyx_breadcrumb_trail_object 2 inc/class-buddyx-breadcrumbs.php:86 The breadcrumb builder object and its args (swap in a custom builder)
buddyx_breadcrumb_trail_labels 1 inc/class-buddyx-breadcrumbs.php:378 The label strings (Home, 404, Search, Pagination, etc.)
buddyx_breadcrumb_trail_post_taxonomy 1 inc/class-buddyx-breadcrumbs.php:398 Which taxonomy supplies the ancestor crumbs for a post type
buddyx_breadcrumb_trail_items 2 inc/class-buddyx-breadcrumbs.php:491 The assembled array of trail items before markup
buddyx_breadcrumb_trail 2 inc/class-buddyx-breadcrumbs.php:331 The final breadcrumb HTML string
buddyx_attr_{$context} 3 inc/class-buddyx-breadcrumbs.php:62 The attribute array for a dynamic context (e.g. buddyx_attr_breadcrumb-buddyx-trail-items-num-meta). Args: $attr, $context, $args
buddyx_attr_{$context}_output 4 inc/class-buddyx-breadcrumbs.php:35 The final attribute string for a context. Args: $output, $context, $attr, $args

buddyx_attr_{$context} / buddyx_attr_{$context}_output are dynamic - the {$context} segment is filled at runtime, so you hook the specific context you want to target.


Customizer filters

Register controls, mutate field args, or reshape the whole settings config.

Filter Args Applied at What it filters
buddyx_customizer_field_args 2 inc/Customizer_Framework/Field.php:99 Per-field args when a control is registered. Args: $args, $wp_customize. Use to force postMessage transport, defaults, sanitize callbacks
buddyx_customizer_field_type_map 1 inc/Customizer_Framework/Field.php:23 The map of field type string to its control class. Register or override control types here
buddyx_custom_background_args 1 inc/Custom_Background/Component.php:43 Args passed to add_theme_support( 'custom-background' )
buddyx_custom_header_args 1 inc/Custom_Header/Component.php:49 Args passed to add_theme_support( 'custom-header' )
buddyx_custom_logo_args 1 inc/Custom_Logo/Component.php:65 Args passed to add_theme_support( 'custom-logo' )
buddyx_variation_is_dark_scheme 2 inc/Custom_Logo/Component.php:156 Whether a given style variation is a dark scheme. Args: $is_dark, $slug. Override per variation slug

Example: register a control type used by a plugin

add_filter( 'buddyx_customizer_field_type_map', function ( $type_map ) {
    $type_map['my-range'] = 'My_Plugin_Customize_Range_Control';
    return $type_map;
} );

Search filters

See the Search page for the full explanation and examples.

Filter Args Where Filters
buddyx_use_buddynext_header_search 1 inc/compatibility/buddynext/buddynext-functions.php:43 Whether the header search icon opens BuddyNext search (default true)
buddyx_search_federation 1 inc/compatibility/wbcom-search/search-federation.php:71 Whether Wbcom plugin result panels render on the search page (default true)
buddyx_search_federation_providers 1 inc/compatibility/wbcom-search/search-federation.php:180 The provider list keyed by id
buddyx_search_federation_excluded_providers 1 inc/compatibility/wbcom-search/search-federation.php:200 Provider ids to drop (applied last)
buddyx_search_federation_buddynext_direct_link_types 1 inc/compatibility/wbcom-search/search-federation.php:357 BuddyNext result types whose own link is trusted
buddyx_search_federation_buddynext_cpt_types 1 inc/compatibility/wbcom-search/search-federation.php:552 BuddyNext result types stored as WordPress posts
buddyx_search_federation_buddynext_row_url 3 inc/compatibility/wbcom-search/search-federation.php:581 The final link for one BuddyNext result row
evnm_event_permalink 3 inc/compatibility/wbcom-search/search-federation.php:149 Eventonomy's event link, asked for when an event result has no URL of its own. Filter it in Eventonomy, not the theme

Conditional asset filters

BuddyX loads the Events Calendar, IdeaPush, LearnDash, bbPress, and Dokan stylesheets only on pages that use them. Each helper first checks the plugin's own conditional tags, then asks a filter. Return true to force the stylesheet on a page BuddyX does not recognize, for example a page that embeds a Dokan shortcode.

Filter Args Where Default
buddyx_needs_event_calendar_assets 1 inc/Helpers/Conditional_Assets.php:79 false
buddyx_needs_ideapush_assets 1 inc/Helpers/Conditional_Assets.php:111 false
buddyx_needs_learndash_assets 1 inc/Helpers/Conditional_Assets.php:122 false
buddyx_needs_bbpress_assets 1 inc/Helpers/Conditional_Assets.php:166 false
buddyx_needs_dokan_assets 1 inc/Helpers/Conditional_Assets.php:206 false
add_filter( 'buddyx_needs_dokan_assets', function ( $needs ) {
	return $needs || is_page( 'vendor-signup' );
} );

Columns and image-size filters

BuddyX registers thumbnail sizes for its blog layouts (Default, List, Grid 2-col, Grid 3-col, Large, Featured). Each dimension is filterable. All defined in inc/Post_Thumbnails/Component.php, each takes 1 arg.

Filter Applied at Default Purpose
buddyx_enable_post_thumbnails inc/Post_Thumbnails/Component.php:50 true Whether featured images render on archives / posts
buddyx_featured_width :63 900 Single-post featured image width
buddyx_featured_height :64 515 Single-post featured image height
buddyx_featured_crop :65 true Featured crop behavior
buddyx_large_width :70 1024 Large card width
buddyx_large_height :71 508 Large card height
buddyx_large_crop :72 false Large crop behavior
buddyx_list_width :77 300 List-layout image width
buddyx_list_height :78 250 List-layout image height
buddyx_list_crop :79 true List crop behavior
buddyx_col_two_width :84 450 Grid 2-column width
buddyx_col_two_height :85 300 Grid 2-column height
buddyx_col_two_crop :86 true Grid 2-column crop behavior
buddyx_col_three_width :91 350 Grid 3-column width
buddyx_col_three_height :92 250 Grid 3-column height
buddyx_col_three_crop :93 true Grid 3-column crop behavior

Verify defaults before relying on them: grep -A3 "buddyx_featured_width" inc/Post_Thumbnails/Component.php. Most sites never need these - use them only when your image strategy conflicts with BuddyX defaults (e.g. a site-wide 16:9 ratio).

Example: disable featured images on archives only

add_filter( 'buddyx_enable_post_thumbnails', function ( $enabled ) {
    return is_archive() ? false : $enabled;
} );

Entry and content filters

Header, footer, and search-toggle output. Defined in inc/extra.php.

Filter Args Applied at What it filters
buddyx_footer_copyright_text 1 inc/extra.php:310 The final footer copyright string. Supports [current_year], [site_title], [theme_author] placeholders
buddyx_search_slide_toggle_data_attrs 1 inc/extra.php:235 Data attributes printed on the sliding search wrapper
buddyx_search_field_toggle_data_attrs 1 inc/extra.php:239 Data attributes printed on the search field container

Example: replace the footer copyright

add_filter( 'buddyx_footer_copyright_text', function ( $text ) {
    return '© [current_year] [site_title]. Built with care.';
} );

CSS, JS, and font filters

Asset orchestration and web-font loading. The CSS/JS manifests are the single source of truth for conditional enqueues - see the Asset Manifest page for the entry schema.

Filter Args Applied at What it filters
buddyx_css_files 1 inc/Styles/Component.php:479 The full CSS manifest (handle to entry map). Disable, replace, or add stylesheets
buddyx_js_files 1 inc/Scripts/Component.php:236 The full JS manifest
buddyx_preloading_styles_enabled 1 inc/Styles/Component.php:392 Whether <link rel="preload"> tags are emitted for theme stylesheets
buddyx_fontawesome_css 1 inc/Styles/Component.php:116 The Font Awesome stylesheet URL, for example to point at a self-hosted kit
buddyx_google_fonts 1 inc/Fonts/Component.php:311 The list of Google fonts to load. Add or remove families
buddyx_local_google_fonts_format 1 inc/Webfont/class-buddyx-webfont-loader.php:571 Font format for locally cached fonts (default woff2)
buddyx_local_font_file_name 1 inc/Webfont/class-buddyx-webfont-loader.php:559 Filename used when caching Google Fonts locally
buddyx_local_fonts_base_path 1 inc/Webfont/class-buddyx-webfont-loader.php:594 Filesystem path for cached local fonts
buddyx_local_fonts_base_url 1 inc/Webfont/class-buddyx-webfont-loader.php:608 URL for cached local fonts
buddyx_local_fonts_directory_name 1 inc/Webfont/class-buddyx-webfont-loader.php:622 Directory name (under wp-content/uploads/) for cached fonts
buddyx_speculation_rules 1 inc/Speculation_Rules/Component.php:119 The Speculation Rules API config (predictive prefetch/prerender)

Example: add a Google font family

add_filter( 'buddyx_google_fonts', function ( $fonts ) {
    $fonts['Geist'] = array( '400', '500', '600', '700' );
    return $fonts;
} );

Example: remove a stylesheet from the manifest

add_filter( 'buddyx_css_files', function ( $css_files ) {
    unset( $css_files['buddyx-loader'] );
    return $css_files;
} );

To simply dequeue one stylesheet, prefer the WordPress-native way - wp_dequeue_style( 'buddyx-google-fonts' ) on wp_enqueue_scripts at priority 20. Reach for buddyx_css_files when you are doing conditional asset orchestration across many handles.


BuddyPress and community filters

These fire only when the relevant integration is active (BuddyPress, rtMedia).

Filter Args Applied at What it filters
bp_get_activity_content 2 inc/extra.php:1028 Activity item content rendered by the theme. Re-applied via apply_filters_ref_array() with $excerpt, $activity
bp_activity_excerpt_append_text 1 inc/extra.php:1062 Text appended to a truncated activity excerpt (default ellipsis)
buddyx_add_feature_image_blog_post_as_activity_content 2 inc/extra.php:1005 Whether a blog post's featured image is injected into its activity entry
buddyx_bp_get_activity_css_first_class 2 inc/compatibility/buddypress/buddypress-functions.php:75 The first CSS class applied to an activity item
buddyx_user_badges_limit 1 inc/compatibility/buddypress/buddypress-functions.php:190 Max number of member badges shown
bp_buddyx_user_progress 1 inc/widgets/bp-profile-completion-widget.php:309 Raw profile-completion percentage for the widget
bp_buddyx_user_progress_formatted 1 inc/widgets/bp-profile-completion-widget.php:405 Formatted profile-completion string
buddyx_rtmedia_filter_enabled 1 inc/compatibility/rtmedia/rtmedia-functions.php:25 Whether the rtMedia to BuddyX bridge is active

Example: raise the member badge limit

add_filter( 'buddyx_user_badges_limit', function ( $limit ) {
    return 8;
} );

Third-party filters applied in template overrides

BuddyX ships template overrides for WooCommerce, search, and rtMedia. The following filters appear in those overrides but are owned by WooCommerce / WordPress core / rtMedia, not BuddyX. Hook them the same way, but consult the upstream plugin's docs for their contracts - BuddyX only re-applies them at the standard override points.

Filter Args Applied at Owner
woocommerce_show_page_title 1 woocommerce/archive-product.php:33 WooCommerce
woocommerce_cart_item_class 3 woocommerce/cart/cart.php:71 WooCommerce
woocommerce_cart_item_product 3 woocommerce/cart/cart.php:43 WooCommerce
woocommerce_cart_item_product_id 3 woocommerce/cart/cart.php:44 WooCommerce
woocommerce_cart_item_visible 3 woocommerce/cart/cart.php:54 WooCommerce
woocommerce_cart_item_name 3 woocommerce/cart/cart.php:68 WooCommerce
woocommerce_cart_item_permalink 3 woocommerce/cart/cart.php:69 WooCommerce
woocommerce_cart_item_thumbnail 3 woocommerce/cart/cart.php:105 WooCommerce
woocommerce_cart_item_backorder_notification 2 woocommerce/cart/cart.php:135 WooCommerce
woocommerce_cart_item_price 3 woocommerce/cart/cart.php:142 WooCommerce
woocommerce_cart_item_quantity 3 woocommerce/cart/cart.php:168 WooCommerce
woocommerce_cart_item_subtotal 3 woocommerce/cart/cart.php:174 WooCommerce
post_type_archive_title 2 inc/class-buddyx-breadcrumbs.php:721 WordPress core
search_placeholder 1 searchform.php:11 WordPress core (theme-defined)
rtm_main_template_buddypress_enable 1 rtmedia/main.php:42 rtMedia

Finding more

List every filter call site with file and line:

grep -rn "apply_filters" inc/ --include="*.php"

Inspect one filter's context:

grep -rn "buddyx_search_field_toggle_data_attrs" inc/

Related