[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/ -> bp-core-taxonomy.php (summary)

BuddyPress taxonomy functions. Most BuddyPress taxonomy functions are wrappers for their WordPress counterparts. Because BuddyPress can be activated in various ways in a network environment, we must switch to the root blog before using the WP functions.

File Size: 502 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions

  bp_get_default_taxonomies()
  bp_register_default_taxonomies()
  bp_get_taxonomy_term_site_id()
  bp_set_object_terms()
  bp_get_object_terms()
  bp_remove_object_terms()
  bp_get_objects_in_term()
  bp_get_term_by()
  bp_insert_term()
  bp_get_terms()
  bp_delete_term()

Functions
Functions that are not part of a class:

bp_get_default_taxonomies()   X-Ref
Returns default BuddyPress taxonomies.

return: array The BuddyPress default taxonomies.
since: 7.0.0

bp_register_default_taxonomies()   X-Ref
Register our default taxonomies.

since: 2.2.0

bp_get_taxonomy_term_site_id( $taxonomy = '' )   X-Ref
Gets the ID of the site that BP should use for taxonomy term storage.

Defaults to the root blog ID.

param: string $taxonomy Taxonomy slug to check for.
return: int
since: 2.6.0

bp_set_object_terms( $object_id, $terms, $taxonomy, $append = false )   X-Ref
Set taxonomy terms on a BuddyPress object.

param: int          $object_id Object ID.
param: string|array $terms     Term or terms to set.
param: string       $taxonomy  Taxonomy name.
param: bool         $append    Optional. True to append terms to existing terms. Default: false.
return: array Array of term taxonomy IDs.
since: 2.2.0

bp_get_object_terms( $object_ids, $taxonomies, $args = array()   X-Ref
Get taxonomy terms for a BuddyPress object.

param: int|array    $object_ids ID or IDs of objects.
param: string|array $taxonomies Name or names of taxonomies to match.
param: array        $args       See {@see wp_get_object_terms()}.
return: array
since: 2.2.0

bp_remove_object_terms( $object_id, $terms, $taxonomy )   X-Ref
Remove taxonomy terms on a BuddyPress object.

param: int          $object_id Object ID.
param: string|array $terms     Term or terms to remove.
param: string       $taxonomy  Taxonomy name.
return: bool|WP_Error True on success, false or WP_Error on failure.
since: 2.3.0

bp_get_objects_in_term( $term_ids, $taxonomies, $args = array()   X-Ref
Retrieve IDs of objects in valid taxonomies and terms for BuddyPress-related taxonomies.

Note that object IDs are from the `bp_get_taxonomy_term_site_id()`, which on some
multisite configurations may not be the same as the current site.

param: int|array    $term_ids   Term id or array of term ids of terms that will be used.
param: string|array $taxonomies String of taxonomy name or Array of string values of taxonomy names.
param: array|string $args       Change the order of the object_ids, either ASC or DESC.
return: WP_Error|array If the taxonomy does not exist, then WP_Error will be returned. On success,
since: 2.7.0

bp_get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filter = 'raw' )   X-Ref
Get term data for terms in BuddyPress taxonomies.

Note that term data is from the `bp_get_taxonomy_term_site_id()`, which on some
multisite configurations may not be the same as the current site.

param: string     $field    Either 'slug', 'name', 'id' (term_id), or 'term_taxonomy_id'
param: string|int $value    Search for this term value
param: string     $taxonomy Taxonomy name. Optional, if `$field` is 'term_taxonomy_id'.
param: string     $output   Constant OBJECT, ARRAY_A, or ARRAY_N
param: string     $filter   Optional, default is raw or no WordPress defined filter will applied.
return: WP_Term|bool WP_Term instance on success. Will return false if `$taxonomy` does not exist
since: 2.7.0

bp_insert_term( $term, $taxonomy = '', $args = array()   X-Ref
Add a new taxonomy term to the database.

param: string $term     The BP term name to add.
param: string $taxonomy The BP taxonomy to which to add the BP term.
param: array  $args {
return: array|WP_Error An array containing the `term_id` and `term_taxonomy_id`,
since: 7.0.0

bp_get_terms( $args = array()   X-Ref
Get taxonomy BP Terms from the database.

param: array  $args {
return: array The list of terms matching arguments.
since: 7.0.0

bp_delete_term( $term_id = 0, $taxonomy = '' )   X-Ref
Deletes a BP Term.

param: int     $term_id  The BP Term ID. Required.
param: string  $taxonomy The BP Taxonomy Name. Required.
return: bool|WP_Error True on success, WP_Error on failure.
since: 7.0.0



Generated: Thu Apr 25 01:01:12 2024 Cross-referenced by PHPXref 0.7.1