bboss_global_search_helpers_acf

Load search helpers for each searchable acf group.

Description

(array) bboss_global_search_helpers_acf( (array) $helpers ); 

Returns (array)

Parameters (1)

0. $helpers (array)
The helpers.

Usage

  1. if ( !function_exists( 'bboss_global_search_helpers_acf' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-global-search/includes/plugins/search-acf/index.php'; 
  3.  
  4. // The helpers. 
  5. $helpers = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bboss_global_search_helpers_acf($helpers); 
  9.  

Defined (1)

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

/includes/plugins/search-acf/index.php  
  1. function bboss_global_search_helpers_acf( $helpers ) { 
  2. /** 
  3. * Check which acfs we need to search. 
  4. * And create one helper class object for each. 
  5. */ 
  6. $searchable_types = buddyboss_global_search()->option( 'items-to-search' ); 
  7.  
  8. foreach ( $searchable_types as $searchable_type ) { 
  9. //if name starts with acf- 
  10.  
  11. $pos = strpos( $searchable_type, 'acf-' ); 
  12. if ( $pos === 0 ) { 
  13. $acf_field_group = str_replace( 'acf-', '', $searchable_type ); 
  14. require_once BUDDYBOSS_GLOBAL_SEARCH_PLUGIN_DIR . 'includes/plugins/search-acf/class.BBoss_Global_Search_ACF.php'; 
  15. $helpers[ $searchable_type ] = new BBoss_Global_Search_ACF( $acf_field_group ); 
  16.  
  17. return $helpers;