Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/23/2013 09:29:19 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Introduce helper function for getting the BuddyPress component name, and filter new BuddyPress function to include it in registered components. Fixes #2495. Hat-tip imath. (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/extend/buddypress/functions.php

    r5161 r5232  
    1313
    1414/** BuddyPress Helpers ********************************************************/
     15
     16/**
     17 * Return bbPress's component name/ID ('forums' by default)
     18 *
     19 * This is used primarily for Notifications integration.
     20 *
     21 * @since bbPress (r5232)
     22 * @return string
     23 */
     24function bbp_get_component_name() {
     25
     26    // Use existing ID
     27    if ( !empty( bbpress()->extend->buddypress->id ) ) {
     28        $retval = bbpress()->extend->buddypress->id;
     29
     30    // Use default
     31    } else {
     32        $retval = 'forums';
     33    }
     34
     35    return apply_filters( 'bbp_get_component_name', $retval );
     36}
    1537
    1638/**
Note: See TracChangeset for help on using the changeset viewer.