Search
Free themeHow BuddyX search works with the Wbcom plugins, and the hooks that change it.
Requires PHP 8.1+. There are two separate pieces: the header search icon and the search results page.
Header search (BuddyNext)
When BuddyNext is active, the header search icon opens BuddyNext's community search. It is the same palette as Ctrl+K on BuddyNext pages, and on other pages it lands on the community search page. Without BuddyNext the icon opens the normal WordPress search overlay.
Keep the WordPress overlay even with BuddyNext active:
add_filter( 'buddyx_use_buddynext_header_search', '__return_false' );
Search results from Wbcom plugins
WordPress search only sees posts, pages, and public custom post types. A member searching for a space name, an event, or a course got "No results" even though the content exists, because that content lives in a plugin's own tables.
BuddyX keeps the normal results list exactly as it is and adds one short panel per active plugin below it: the first few matches as links, then a See all link to that plugin's own search page.
| Provider id | Panel title | Plugin |
|---|---|---|
buddynext |
BuddyNext results | BuddyNext (members, Spaces, posts, hashtags, and add-on types such as jobs or listings) |
jetonomy |
Discussions | Jetonomy |
eventonomy |
Events | Eventonomy |
mediaverse |
Media & Documents | WPMediaVerse |
learnomy |
Courses | Learnomy |
How it behaves:
- Additive only. If no supported plugin is active, or nothing matches, the search page is unchanged.
- Privacy is the plugin's. Each provider runs as the current visitor, so a private Space or a members-only course only appears for people who are allowed to see it.
- Cached for 5 minutes per search term and visitor.
- The empty state adapts. When a panel has matches but no posts matched, the "nothing matched" line becomes "No posts or pages matched your search. See related results below."
Turn it off or trim it
// Switch the panels off entirely.
add_filter( 'buddyx_search_federation', '__return_false' );
// Keep one plugin's results off the search page.
add_filter( 'buddyx_search_federation_excluded_providers', function ( $ids ) {
$ids[] = 'eventonomy';
return $ids;
} );
Exclusions are applied last, so they always win.
Hooks
| Hook | Type | Arguments | What it does |
|---|---|---|---|
buddyx_search_after_results |
action | none | Fires on the search results page after the normal results loop (index.php, optional/search.php). The panels render here. |
buddyx_search_federation |
filter | bool $enabled (default true) |
Return false to switch the panels off. |
buddyx_search_federation_providers |
filter | array $providers |
The provider list keyed by id. Each entry has label, priority, and a callback. Add or remove providers here. |
buddyx_search_federation_excluded_providers |
filter | string[] $excluded (default empty) |
Provider ids to drop. Built-in ids: buddynext, jetonomy, eventonomy, mediaverse, learnomy. |
buddyx_search_federation_buddynext_direct_link_types |
filter | array $types |
BuddyNext result types whose own link is trusted. Default user, member, space, post, media. Other types link to BuddyNext's search page. |
buddyx_search_federation_buddynext_cpt_types |
filter | array $types |
BuddyNext result types stored as WordPress posts, so BuddyX links them to the post permalink. Default job, listing, company, resume, employer, candidate. |
buddyx_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) |
Return false to keep the WordPress search overlay in the header. |