buddyboos_global_search_items

Buddyboss global search items options.

Description

(mixed|void) buddyboos_global_search_items(); 

Returns (mixed|void)


Usage

  1. if ( !function_exists( 'buddyboos_global_search_items' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-global-search/includes/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = buddyboos_global_search_items(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/functions.php  
  1. function buddyboos_global_search_items() { 
  2.  
  3. $items = array( 
  4. 'posts' => __( 'Blog Posts', 'buddypress-global-search' ),  
  5. 'posts_comments' => __( 'Post Comments', 'buddypress-global-search' ),  
  6. 'members' => __( 'Members', 'buddypress-global-search' ),  
  7. ); 
  8.  
  9. //forums? 
  10. if ( is_plugin_active( 'bbpress/bbpress.php' ) ) { 
  11. $items['forum'] = __( 'Forums', 'buddypress-global-search' ); 
  12. $items['topic'] = __( 'Forums Topics', 'buddypress-global-search' ); 
  13. $items['reply'] = __( 'Forums Replies', 'buddypress-global-search' ); 
  14.  
  15. //other buddypress components 
  16. $bp_components = array( 
  17. 'groups' => __( 'Groups', 'buddypress-global-search' ),  
  18. 'activity' => __( 'Activity', 'buddypress-global-search' ),  
  19. 'messages' => __( 'Messages', 'buddypress-global-search' ),  
  20. /** should we search notifications as well? 
  21. 'notifications' => __( 'Notifications', 'buddypress-global-search' ), */ 
  22. ); 
  23.  
  24. //only the active ones please! 
  25. foreach( $bp_components as $component=>$label ) { 
  26. if( function_exists( 'bp_is_active' ) && bp_is_active( $component ) ) { 
  27. $items[$component] = $label; 
  28.  
  29. if ( 'activity' === $component ) { 
  30. $items['activity_comment'] = __( 'Activity Comment', 'buddypress-global-search' ); 
  31.  
  32. return apply_filters( 'buddyboos_global_search_items', $items );