Skip to content

Hooks & Filters Reference

BuddyX Theme overviewFree + ProGet BuddyX Theme →

Reference of the significant action hooks and filters the BuddyX Pro theme fires. Every hook listed here is fired (do_action) or applied (apply_filters) in the shipped 5.1.4 code. Plugin hooks the theme only listens to (core WordPress, BuddyPress, WooCommerce, LearnDash, etc.) are out of scope - see those projects’ own references.

BuddyX Pro fires a large surface (roughly 55 own actions and 70 own filters). This page documents the ones you are most likely to hook. Grep the code for do_action( 'buddyx / apply_filters( 'buddyx to see the complete set.


Fired from header.php and footer.php.

Hook Fires
buddyx_head_top Immediately inside <head>
buddyx_head_bottom End of <head>, before </head>
buddyx_body_top Right after <body> opens (also fires buddyx_wp_body_open)
buddyx_page_top Top of #page wrapper
buddyx_page_bottom Bottom of #page, before wp_footer()
buddyx_body_bottom After wp_footer(), before </body>
add_action( 'buddyx_head_bottom', 'my_head_meta' );
function my_head_meta() {
echo '<meta name="theme-color" content="#c92a2b">';
}

Fired from header.php and the header template parts.

Hook Fires
buddyx_header_before Before the <header id="masthead"> element
buddyx_header_wrapper_before Inside the header, before the inner wrapper
buddyx_header_wrapper_after Inside the header, after the inner wrapper
buddyx_header_after After the </header> element
buddyx_header_actions Inside the desktop menu-icons area (search / cart / color-mode toggle)
buddyx_mobile_menu_actions Inside the mobile navigation actions (template-parts/header/navigation.php)

There is no buddyx_header hook - that name is not fired anywhere in the theme. Use buddyx_header_actions to add header widgets. The Color_Mode_Toggle component hooks its toggle onto buddyx_header_actions at priority 50.

// Add a header widget next to the search / cart icons.
add_action( 'buddyx_header_actions', 'my_header_widget', 20 );
function my_header_widget() {
echo '<div class="my-header-widget">Hi</div>';
}

The most widely used pair - fired around the main content area from every top-level template (index.php, single.php, page.php, archive.php, buddypress.php, bbpress.php, the FluentCart/LearnDash templates, etc.).

Hook Fires
buddyx_before_content Before the content container opens
buddyx_after_content After the content container closes
add_action( 'buddyx_before_content', 'my_content_notice' );
function my_content_notice() {
echo '<div class="my-notice">Custom content here</div>';
}
Hook Fires
buddyx_sub_header Page-title / sub-header area, after the site header

Default callback: buddyx_sub_header().

// Replace the default page header.
remove_action( 'buddyx_sub_header', 'buddyx_sub_header' );
add_action( 'buddyx_sub_header', 'my_page_header' );
function my_page_header() {
echo '<div class="my-page-header">Custom Header</div>';
}

Fired from the template-parts/content/ and template-parts/layout/ parts.

Hook Fires
buddyx_entry_before Before an entry <article>
buddyx_entry_after After an entry <article>
buddyx_entry_content_before Before the entry content
buddyx_entry_content_after After the entry content
buddyx_entry_meta_after After the entry meta row
buddyx_before_archive_loop Before the archive loop starts
add_action( 'buddyx_entry_content_after', 'my_after_post' );
function my_after_post() {
if ( is_singular( 'post' ) ) {
echo '<div class="author-bio">...</div>';
}
}
Hook Fires
buddyx_before_breadcrumb Before the breadcrumb trail
buddyx_after_breadcrumb After the breadcrumb trail

Fired from sidebar.php / sidebar-buddypress.php.

Hook Fires
buddyx_sidebar_before Before the sidebar widget area
buddyx_sidebar_after After the sidebar widget area

Fired from footer.php and template-parts/footer/info.php.

Hook Fires
buddyx_footer_before Before the <footer> element
buddyx_footer_after After the <footer> element
buddyx_copyright_before Before the copyright row
buddyx_copyright_after After the copyright row
add_action( 'buddyx_footer_before', 'my_prefooter' );
function my_prefooter() {
echo '<div class="pre-footer">Newsletter signup</div>';
}

Fired from template-parts/header/buddyx-panel.php.

Hook Fires
buddyx_before_inner_panel Before the inner side-panel content
buddyx_after_inner_panel After the inner side-panel content

Fired from the login/register form parts.

Hook Fires
buddyx_login_form_top / buddyx_login_form_bottom Top / bottom of the login form
buddyx_register_form_top / buddyx_register_form_bottom Top / bottom of the registration form
buddyxpro_recaptcha_after_login_form After the login form (reCAPTCHA seam)
buddyxpro_recaptcha_after_register_form After the register form (reCAPTCHA seam)
Hook Fires Parameters
buddyx_pro_post_comment_before Before the post comments section -
buddyx_pro_before_comment_replay Before the comment reply link $comment_id, $comment
buddyx_pro_after_comment_replay After the comment reply link $comment_id, $comment
add_action( 'buddyx_pro_after_comment_replay', 'my_comment_actions', 10, 2 );
function my_comment_actions( $comment_id, $comment ) {
echo '<button class="report-comment">Report</button>';
}
Hook Fires
buddyx_before_member_avatar_member_directory Before a member avatar in the members directory
buddyx_before_group_avatar_group_directory Before a group avatar in the groups directory
buddyx_before_item_meta / buddyx_after_item_meta Around directory item meta
buddyx_buddypress_member_send_message_button_call Around the member “send message” button

Fired from the Dokan store container (inc/compatibility/dokan/dokan-functions.php).

Hook Fires
buddyx_store_container_open Inside the store-page container open
buddyx_store_container_close Inside the store-page container close

Fired from the FluentCart single-product template (all default priority 10).

Hook Fires
buddyx_fluentcart_before_product_content / buddyx_fluentcart_after_product_content Start / end of the product template
buddyx_fluentcart_before_product_header / buddyx_fluentcart_after_product_header Around product title and meta
buddyx_fluentcart_before_product_description / buddyx_fluentcart_after_product_description Around the product description
buddyx_fluentcart_product_tabs Product tabs area
buddyx_fluentcart_before_related_products / buddyx_fluentcart_after_related_products Around related products
add_action( 'buddyx_fluentcart_after_product_header', 'my_trust_badges' );
function my_trust_badges() {
echo '<div class="trust-badges">Secure checkout</div>';
}

Asset Manifest Filters (primary extension seams)

Section titled “Asset Manifest Filters (primary extension seams)”

These are the recommended entry points for adding, removing, or reconfiguring theme assets. See the Theme Architecture asset section.

File: inc/Styles/Component.php

Filters the CSS manifest ($handle => $data map) that drives every conditional stylesheet enqueue. Add an entry to register a new integration stylesheet, or unset one to drop it.

add_filter( 'buddyxpro_css_files', function ( $css_files ) {
$css_files['my-integration'] = array(
'file' => 'my-integration.css',
'global' => false,
'preload_callback' => function () {
return class_exists( 'My_Plugin' );
},
'media' => 'all',
'deps' => array(),
'loading' => null,
);
return $css_files;
} );

File: inc/Scripts/Component.php

Filters the JavaScript manifest that drives every conditional script enqueue (same shape, with footer / localize keys).

add_filter( 'buddyxpro_js_files', function ( $js_files ) {
unset( $js_files['buddyxpro-entry-share-popup'] ); // drop share popup
return $js_files;
} );

File: inc/Styles/Component.php

Whether the theme preloads its non-global stylesheets. When true, action_preload_styles() prints a <link rel="preload" ... onload="this.rel='stylesheet'"> tag in wp_head for every registered stylesheet whose preload_callback returns true, and template parts print the real link tag in-body through buddyxpro()->print_styles(). Return false and those stylesheets are enqueued directly on wp_enqueue_scripts instead, while print_styles() becomes a no-op.

Default: ! buddyxpro()->is_amp() - true on a normal request, false on an AMP request.

File: inc/Styles/Component.php

Whether the Font Awesome stylesheet (buddyxpro-load-fontawesome) loads on every page. The theme’s own icons are SVG and do not need it; plugins that print Font Awesome icons, and Font Awesome classes a site owner entered (menu icons, top bar, profile social links, course features), do. When the filter returns false the stylesheet is only registered, so a plugin or template can still call wp_enqueue_style( 'buddyxpro-load-fontawesome' ).

Default: the General > Site Performance > Load Font Awesome Customizer setting (site_load_fontawesome), on by default.

add_filter( 'buddyxpro_load_fontawesome', '__return_false' );
Filter Args What it filters
buddyx_member_url 2 The member profile URL used by the header, menus and member lists. Receives $url and $user_id; return the URL to use. When BuddyPress is not active, the header opens the member’s Jetonomy profile.
add_filter( 'buddyx_member_url', function ( $url, $user_id ) {
return $url;
}, 10, 2 );

Each of these integration stylesheets has a helper in inc/Helpers/Conditional_Assets.php that sniffs the request and decides whether the CSS is needed. The filter sits at the end of the helper, so it runs only after every built-in sniff has already failed. Use it to force the CSS onto pages the sniff cannot see: custom templates, PHP-only shortcode calls, page builders.

Filter Stylesheets it can force Default
buddyxpro_needs_event_calendar_assets buddyx-eventscalendar false
buddyxpro_needs_learndash_assets buddyx-learndash, the buddyx-dark-mode focus-mode overrides, and buddyx-ld-dashboard (that one also needs the Ld_Dashboard class) false
buddyxpro_needs_bbpress_assets buddyx-bbpress false
buddyxpro_needs_dokan_assets buddyx-dokan false
buddyxpro_needs_buddypress_assets buddyx-buddypress, bp-plugin-support false
buddyxpro_needs_woocommerce_assets buddyxpro-woocommerce (printed in the head) false
buddyxpro_needs_ideapush_assets buddyx-ideapush false

Returning false cannot switch a stylesheet off, because a sniff that already matched returns before the filter runs. The Events Calendar, LearnDash, Dokan, BuddyPress and WooCommerce helpers return early when their plugin is missing, so returning true does nothing without that plugin active. The bbPress and IdeaPush helpers have no such early return.

// Load the LearnDash CSS on a custom template the sniff cannot detect.
add_filter( 'buddyxpro_needs_learndash_assets', function ( $needs_assets ) {
return is_page_template( 'my-course-hub.php' ) ? true : $needs_assets;
} );

File: inc/Post_Thumbnails/Component.php

The theme registers five custom image sizes on after_setup_theme. Each size takes three filters: width, height, and the crop argument passed to add_image_size(). These are developer-only. The sizes are registered in code and are not offered in the media UI.

Size Width filter Height filter Crop filter Defaults Used for
buddyxpro-featured buddyxpro_featured_width buddyxpro_featured_height buddyxpro_featured_crop 900, 515, true Magazine-layout feature cards, 1-column grid and masonry cards, and the default archive thumbnail
buddyxpro-large buddyxpro_large_width buddyxpro_large_height buddyxpro_large_crop 1024, 508, false The featured image on singular posts
buddyxpro-list buddyxpro_list_width buddyxpro_list_height buddyxpro_list_crop 300, 250, true Archive thumbnails when the blog layout is list layout
buddyxpro-col-two buddyxpro_col_two_width buddyxpro_col_two_height buddyxpro_col_two_crop 450, 300, true Grid and masonry archive thumbnails at exactly 2 columns
buddyxpro-col-three buddyxpro_col_three_width buddyxpro_col_three_height buddyxpro_col_three_crop 350, 250, true Grid and masonry archive thumbnails at 3 or more columns, and the editorial layout

buddyxpro-large is the only theme size that is not hard-cropped by default. The layout that picks between list, grid and masonry is the blog_layout_option setting under Appearance > Customize.

Add your callbacks from a child theme functions.php or a must-use plugin so they are in place before after_setup_theme fires, then regenerate thumbnails so existing uploads get the new dimensions.

add_filter( 'buddyxpro_featured_width', function () {
return 1200;
} );
Filter File Purpose
buddyxpro_customizer_settings inc/Customizer_Settings/ Filters the full customizer settings definition
buddyx_customizer_field_type_map inc/Customizer_Framework/ Maps field type to control class
buddyx_customizer_field_args inc/Customizer_Framework/ Filters per-field args before registration
buddyxpro_color_scheme_presets inc/Customizer_Settings/ Color-scheme preset list
buddyxpro_typography_presets - Typography preset list
buddyxpro_header_presets - Header layout presets
buddyxpro_google_fonts inc/Fonts/ Available Google font list
Filter Purpose
buddyx_breadcrumb_trail_args Default breadcrumb args
buddyx_breadcrumb_trail_items Final breadcrumb items array
buddyx_breadcrumb_trail_labels Breadcrumb label strings
buddyx_breadcrumb_trail_object Short-circuit with a custom trail object
buddyx_breadcrumb_trail Final rendered breadcrumb HTML
Filter Returns
buddyx_search_slide_toggle_data_attrs Data-attribute string for the search toggle button
buddyx_search_field_toggle_data_attrs Data-attribute string for the search field container
add_filter( 'buddyx_search_slide_toggle_data_attrs', function () {
return 'data-animation="slide" data-speed="300"';
} );
Filter Purpose
buddyxpro_minimal_layout_force_no_sidebar Force no sidebar in the minimal layout
buddyxpro_display_title_and_description Toggle archive title + description output
buddyxpro_filter_archive_posts_per_page Archive posts-per-page override
buddyxpro_post_categories_limit Max categories shown per entry
buddyxpro_reading_time_minutes Filter the computed reading time
buddyxpro_page_settings_post_types Post types that get the per-page settings meta box
buddyx_enable_post_thumbnails Toggle post-thumbnail support
buddyx_off_canvas_filter_button_output Off-canvas filter button markup
Filter Purpose
buddyxpro_login_presets Login-page brand presets
buddyxpro_register_page_login_url Register-page login URL
buddyx_lostpassword_url Lost-password URL
buddyxpro_login_frontend_dep_handle Registered style handle the register-page inline login CSS attaches to. Default: buddyxpro-global, the theme’s main handle. Point it at your own handle if your child theme swaps the main stylesheet
Filter Purpose
buddyxpro_install_catalog The recommended-plugins catalog shown by the Plugin Installer / Welcome screen

File: inc/Helpers/Dark_Mode.php (since 5.1.5)

Whether a visitor’s stored color-mode choice (kept in their browser) is ignored and the owner’s site_color_mode default is used instead. It is read by buddyx_color_mode_force_default() and passed to the color-mode bootstrap in <head>.

Default: ! buddyxpro_color_mode_toggle_enabled() - true when the visitor toggle is hidden, false when it is shown. buddyxpro_color_mode_toggle_enabled() reads get_theme_mod( 'site_color_mode_toggle_show', 'on' ), so on a default site the toggle is shown and the filtered default is false.

The two settings it derives from are at Appearance > Customize > Site Skin: “Color mode” (site_color_mode, default light) and “Show color-mode toggle” (site_color_mode_toggle_show, default on).

// Hide the toggle, but still honor a mode the visitor picked earlier.
add_filter( 'buddyxpro_force_default_color_mode', '__return_false' );

File: inc/compatibility/buddynext/buddynext-functions.php (since 5.1.6)

Whether the BuddyX Side Panel is hidden while a BuddyNext hub route renders. When it returns true, buddyx_pro_buddynext_hide_side_panel_locations() (hooked to has_nav_menu) reports the buddyx-panel and buddyx-panel-logged-out menu locations as unassigned, so template-parts/header/buddyx-panel.php skips rendering. That happens on BuddyNext routes only and has no effect anywhere else.

Default: true

Note the prefix on this one: buddyx_pro_, not buddyxpro_.

The filter is reachable only when the compatibility file loads. functions.php requires it when BUDDYNEXT_VERSION is defined and BuddyPress is inactive, and the callback additionally requires \BuddyNext\Core\PageRouter::is_bn_route(). The menu locations it suppresses are “Side Menu - Logged in users” and “Side Menu - Logged out users” under Appearance > Menus > Manage Locations.

// Keep the Side Panel visible on BuddyNext pages.
add_filter( 'buddyx_pro_buddynext_hide_side_panel', '__return_false' );
Filter Purpose
buddyx_bp_is_current_action Whether the current BP action matches (used across BP templates)
buddyx_buddypress_member_send_message_button_url Member “send message” button URL
buddyx_get_member_joined_date Member joined-date string
buddyx_learndash_lms_get_course_participants_per_page Participants per page
buddyx_ld_modify_course_features Course features list
buddyx_ld_filter_course_author_url Course author URL
buddyx_ld_course_card_meta Meta items on a course card
buddyx_ld_course_header_meta Meta items in the single course header
buddyx_ld_course_category_term Category shown for a course
buddyx_ld_after_course_card_meta (action) After the course card meta line
buddyx_ld_after_course_header_meta (action) After the single course header meta line

On the search results page BuddyX Pro keeps the normal WordPress results and adds one short panel per active Wbcom plugin below them: BuddyNext (buddynext), Jetonomy (jetonomy), Eventonomy (eventonomy), WPMediaVerse (mediaverse) and Learnomy (learnomy). Each panel shows the first few matches and a See all link to that plugin’s own search. Panels run as the current visitor, so each plugin’s own privacy rules apply, and results are cached for 5 minutes per search term and visitor. If no supported plugin is active, or nothing matches, the search page is unchanged.

Hook Type Arguments What it does
buddyx_pro_search_after_results action none Fires after the normal results loop in index.php and optional/search.php. The panels render here.
buddyx_pro_search_federation filter bool $enabled (default true) Return false to switch the panels off.
buddyx_pro_search_federation_providers filter array $providers The provider list keyed by id. Each entry has label, priority and a callback.
buddyx_pro_search_federation_excluded_providers filter string[] $excluded (default empty) Provider ids to drop. Applied last, so an exclusion always wins.
buddyx_pro_search_federation_buddynext_direct_link_types filter array $types BuddyNext result types whose own link is trusted. Default user, member, space, post, media.
buddyx_pro_search_federation_buddynext_cpt_types filter array $types BuddyNext result types stored as WordPress posts. Default job, listing, company, resume, employer, candidate.
buddyx_pro_search_federation_buddynext_row_url filter string $url, string $type, array $item The final link for one BuddyNext result row. Return an empty string to leave the row as plain text.
buddyx_use_buddynext_header_search filter bool $use (default true) With BuddyNext active the header search icon opens BuddyNext’s community search. Return false to keep the WordPress search overlay.
// Keep one plugin's results off the search page.
add_filter( 'buddyx_pro_search_federation_excluded_providers', function ( $ids ) {
$ids[] = 'eventonomy';
return $ids;
} );
Hook Type Where What it changes
buddyx_sub_header_show_title filter template-parts/buddyx-page-header.php Whether the sub-header prints the page title (bool). Added in 5.2.0
buddyx_page_header_section_title filter template-parts/buddyx-page-header.php The title text shown in the sub-header
buddyx_search_form action searchform.php Fires before each theme search form. Added in 5.2.0; the theme counts these calls to give every form after the first a unique id, so use get_search_form()
buddyx_search_placeholder filter searchform.php Placeholder text of the theme search form (default Enter Keyword). Added in 5.2.0
buddyx_footer_copyright_text filter inc/extra.php The footer copyright HTML
buddyx_theme_author filter inc/extra.php theme_name and theme_author_url used in the footer credit
buddyx_post_categories filter inc/extra.php The category links HTML printed on posts
buddyx_reply_avatar_count filter inc/extra.php How many reply avatars a bbPress topic shows (default 4; args: count, topic ID)
buddyx_breadcrumb_trail_post_taxonomy filter inc/class-buddyx-breadcrumbs.php Which taxonomy each post type uses in the breadcrumb trail
buddyx_add_feature_image_blog_post_as_activity_content filter inc/Helpers/Activity_Functions.php Image HTML added to a blog-post activity item (args: HTML, post ID)
buddyx_excluded_group_types_for_avatar_activity filter inc/Helpers/Activity_Functions.php Group statuses that get no “changed avatar” activity (default hidden; args: statuses, group)
buddyx_excluded_group_types_for_cover_activity filter inc/Helpers/Activity_Functions.php The same for “changed cover image” activity
buddyx_bp_get_activity_css_first_class filter inc/compatibility/buddypress/buddypress-functions.php Activity types shown as compact one-line items (args: types, component)
buddyx_bp_member_type_name_string filter inc/compatibility/buddypress/buddypress-functions.php The member-type label HTML (args: HTML, member type, user ID)
buddyx_user_badges_limit filter inc/compatibility/buddypress/buddypress-functions.php How many badges a member card shows (default 10)
buddyx_wc_vendors_before_vendor_store_header action wc-vendors/store/store-header.php Before the WC Vendors store header
buddyx_wc_vendors_after_vendor_store_header action wc-vendors/store/store-header.php After the WC Vendors store header
buddyx_wc_vendor_after_rating action wc-vendors/front/vendor-list-loop.php After the rating in the WC Vendors store list
buddyx_wc_vendors_format_store_address_args filter inc/compatibility/wc-vendors/buddyx_wc_vendors_core_functions.php The address parts shown for a vendor (args: parts, vendor ID)
buddyx_wc_vendors_format_store_address_output filter same file The joined address string (args: string, vendor ID)
buddyx_wc_vendors_format_store_url filter same file The vendor website link HTML
buddyx_wc_vendors_get_social_media_settings filter same file The social networks offered for vendor profiles
buddyxpro_custom_logo_args filter inc/Custom_Logo/Component.php Arguments passed to add_theme_support( 'custom-logo' )
buddyxpro_custom_header_args filter inc/Custom_Header/Component.php Arguments passed to add_theme_support( 'custom-header' )
buddyxpro_custom_background_args filter inc/Custom_Background/Component.php Arguments passed to add_theme_support( 'custom-background' )
buddyxpro_header_layout_fallback_css filter inc/Styles/Component.php The small inline CSS that keeps the chosen header layout from shifting before its stylesheet loads
buddyxpro_locally_covered_font_families filter inc/Fonts/Component.php Font families served from the theme’s own files, which the Google Fonts request skips

BuddyX Pro hooks use three prefixes for historical reasons: buddyx_ (shared with the free theme), buddyxpro_ and buddyx_pro_. All three are kept so existing child themes keep working. When you move a child theme from BuddyX to BuddyX Pro, check these renamed hooks:

BuddyX (free) BuddyX Pro
buddyx_css_files, buddyx_js_files buddyxpro_css_files, buddyxpro_js_files
buddyx_needs_*_assets buddyxpro_needs_*_assets
buddyx_force_default_color_mode buddyxpro_force_default_color_mode
buddyx_search_federation* buddyx_pro_search_federation*
buddyx_search_after_results buddyx_pro_search_after_results
buddyx_load_fontawesome buddyxpro_load_fontawesome

The unprefixed search_placeholder filter still applies to the theme search form but logs a deprecation notice; use buddyx_search_placeholder.

These public functions do nothing now and log a deprecation notice when WP_DEBUG is on. Remove calls to them from your child theme.

Function Use instead
buddyx_color_mode_body_class() Read <html data-bx-mode>
buddyx_resolve_color_mode() Read <html data-bx-mode> in the browser
buddyx_migrate_bxtheme_cookie() Nothing; old cookies are read in the browser
buddyx_save_dark_mode() Nothing; the choice is kept in the browser
buddyx_theme_get_custom_logo() The get_custom_logo filter
buddyx_woo_dequeue_styles() buddyxpro_needs_woocommerce_assets
buddyx_bp_core_signup_user_disable_validation() BuddyPress’s own activation

Theme components add their hooks inside initialize():

namespace BuddyxPro\BuddyxPro\MyComponent;
use BuddyxPro\BuddyxPro\Component_Interface;
class Component implements Component_Interface {
public function get_slug(): string {
return 'my_component';
}
public function initialize() {
add_action( 'wp_head', array( $this, 'add_meta_tags' ) );
add_filter( 'body_class', array( $this, 'add_body_classes' ) );
}
public function add_body_classes( $classes ) {
$classes[] = 'my-custom-class';
return $classes;
}
}

  • Use the correct priority (lower = earlier); the color-mode toggle occupies priority 50 on buddyx_header_actions.
  • Check context (is_singular(), is_page(), is_buddypress()) before outputting.
  • Escape all output (esc_html(), esc_attr(), esc_url()).
  • Return a value from filter callbacks - never echo.
  • Prefer the buddyxpro_css_files / buddyxpro_js_files manifest filters over dequeueing by handle where possible.
  • Prefix your callbacks so they never collide with the theme’s buddyx_* / buddyxpro_* functions.