BuddyX

Filter Hooks Reference

Free theme

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


BuddyX fires 67 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.0+. 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_settings 1 inc/EZ_Customizer/Component.php:94 The decoded Customizer settings config (sections, panels, fields) loaded from themeCustomizeSettings.json
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;
} );

Example: add a section to the Customizer config

add_filter( 'buddyx_customizer_settings', function ( $config ) {
    // $config is the array decoded from themeCustomizeSettings.json.
    // Add or adjust sections/fields, then return the whole array.
    $config['sections']['my_plugin_section'] = array(
        'title'    => __( 'My Plugin', 'my-plugin' ),
        'priority' => 200,
    );
    return $config;
} );

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:315 The final footer copyright string. Supports [current_year], [site_title], [theme_author] placeholders
buddyx_search_slide_toggle_data_attrs 1 inc/extra.php:248 Data attributes printed on the sliding search wrapper
buddyx_search_field_toggle_data_attrs 1 inc/extra.php:252 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:442 The full CSS manifest (handle to entry map). Disable, replace, or add stylesheets
buddyx_js_files 1 inc/Scripts/Component.php:274 The full JS manifest
buddyx_preloading_styles_enabled 1 inc/Styles/Component.php:372 Whether <link rel="preload"> tags are emitted for theme stylesheets
buddyx_google_fonts 1 inc/Fonts/Component.php:295 The list of Google fonts to load. Add or remove families
buddyx_local_google_fonts_format 1 inc/Webfont/class-buddyx-webfont-loader.php:566 Font format for locally cached fonts (default woff2)
buddyx_local_font_file_name 1 inc/Webfont/class-buddyx-webfont-loader.php:554 Filename used when caching Google Fonts locally
buddyx_local_fonts_base_path 1 inc/Webfont/class-buddyx-webfont-loader.php:589 Filesystem path for cached local fonts
buddyx_local_fonts_base_url 1 inc/Webfont/class-buddyx-webfont-loader.php:603 URL for cached local fonts
buddyx_local_fonts_directory_name 1 inc/Webfont/class-buddyx-webfont-loader.php:617 Directory name (under wp-content/uploads/) for cached fonts
buddyx_speculation_rules 1 inc/Speculation_Rules/Component.php:115 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:1044 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:1078 Text appended to a truncated activity excerpt (default ellipsis)
buddyx_add_feature_image_blog_post_as_activity_content 2 inc/extra.php:1021 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:397 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:31 WooCommerce
woocommerce_cart_item_class 3 woocommerce/cart/cart.php:68 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:65 WooCommerce
woocommerce_cart_item_permalink 3 woocommerce/cart/cart.php:66 WooCommerce
woocommerce_cart_item_thumbnail 3 woocommerce/cart/cart.php:102 WooCommerce
woocommerce_cart_item_backorder_notification 2 woocommerce/cart/cart.php:132 WooCommerce
woocommerce_cart_item_price 3 woocommerce/cart/cart.php:139 WooCommerce
woocommerce_cart_item_quantity 3 woocommerce/cart/cart.php:165 WooCommerce
woocommerce_cart_item_subtotal 3 woocommerce/cart/cart.php:171 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:38 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