Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@HoussenMoshine
Created October 14, 2017 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HoussenMoshine/7ddc2aa76b5a938b9f9c2b89a55caf03 to your computer and use it in GitHub Desktop.
Save HoussenMoshine/7ddc2aa76b5a938b9f9c2b89a55caf03 to your computer and use it in GitHub Desktop.
/**
* Include bbPress 'topic' custom post type in WordPress' search results */
function ntwb_bbp_topic_cpt_search( $topic_search ) {
$topic_search['exclude_from_search'] = false;
return $topic_search;
}
add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' );
/**
* Include bbPress 'forum' custom post type in WordPress' search results */
function ntwb_bbp_forum_cpt_search( $forum_search ) {
$forum_search['exclude_from_search'] = false;
return $forum_search;
}
add_filter( 'bbp_register_forum_post_type', 'ntwb_bbp_forum_cpt_search' );
/**
* Include bbPress 'reply' custom post type in WordPress' search results */
function ntwb_bbp_reply_cpt_search( $reply_search ) {
$reply_search['exclude_from_search'] = false;
return $reply_search;
}
add_filter( 'bbp_register_reply_post_type', 'ntwb_bbp_reply_cpt_search' );
@HoussenMoshine
Copy link
Author

Un exemple de code pour régler un problème que j'avais sur l'affichage des résultats provenant de BBpress dans Wordpress. https://housseniawriting.com/topic/la-recherche-sur-un-forum-bbpress/#post-8928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment