bp_get_taxonomy_term_site_id

Gets the ID of the site that BP should use for taxonomy term storage.

Description

(int) bp_get_taxonomy_term_site_id( (string) $taxonomy = '' ); 

Defaults to the root blog ID.

Returns (int)

Parameters (1)

0. $taxonomy — Optional. (string) => ''
Taxonomy slug to check for.

Usage

  1. if ( !function_exists( 'bp_get_taxonomy_term_site_id' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-taxonomy.php'; 
  3.  
  4. // Taxonomy slug to check for. 
  5. $taxonomy = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_taxonomy_term_site_id($taxonomy); 
  9.  

Defined (1)

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

/bp-core/bp-core-taxonomy.php  
  1. function bp_get_taxonomy_term_site_id( $taxonomy = '' ) { 
  2. $site_id = bp_get_root_blog_id(); 
  3.  
  4. /** 
  5. * Filters the ID of the site where BP should store taxonomy terms. 
  6. * @since 2.6.0 
  7. * @param int $site_id Site ID to cehck for. 
  8. * @param string $taxonomy Taxonomy slug to check for. 
  9. */ 
  10. return (int) apply_filters( 'bp_get_taxonomy_term_site_id', $site_id, $taxonomy );