[ 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.

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

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

return: array Array of term taxonomy IDs.
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.
since: 2.2.0

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

return: array
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()}.
since: 2.2.0

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

return: bool|WP_Error True on success, false or WP_Error on failure.
param: int          $object_id Object ID.
param: string|array $terms     Term or terms to remove.
param: string       $taxonomy  Taxonomy name.
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.

return: WP_Error|array If the taxonomy does not exist, then WP_Error will be returned. On success,
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.
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.

return: WP_Term|bool WP_Term instance on success. Will return false if `$taxonomy` does not exist
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.
since: 2.7.0

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

return: array|WP_Error An array containing the `term_id` and `term_taxonomy_id`,
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 {
since: 7.0.0

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

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

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

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



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1