Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/27/2017 05:04:31 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Tools: Add //Filter & return note for future discovery of missing filter documentation.

Also adjust some type-casting on filtered results.

File:
1 edited

Legend:

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

    r6415 r6438  
    3030function bbp_get_component_name() {
    3131
    32     // Use existing ID
    33     if ( ! empty( bbpress()->extend->buddypress->id ) ) {
    34         $retval = bbpress()->extend->buddypress->id;
    35 
    36     // Use default
    37     } else {
    38         $retval = 'forums';
    39     }
    40 
     32    // Use existing ID or default
     33    $retval = ! empty( bbpress()->extend->buddypress->id )
     34        ? bbpress()->extend->buddypress->id
     35        : 'forums';
     36
     37    // Filter & return
    4138    return apply_filters( 'bbp_get_component_name', $retval );
    4239}
     
    6562    if ( ! empty( $user_id ) && is_numeric( $user_id ) ) {
    6663        $bbp_user_id = $user_id;
    67     }
    6864
    6965    // Currently viewing or editing a user
    70     elseif ( ( true === $displayed_user_fallback ) && ! empty( $did ) ) {
     66    } elseif ( ( true === $displayed_user_fallback ) && ! empty( $did ) ) {
    7167        $bbp_user_id = $did;
    72     }
    7368
    7469    // Maybe fallback on the current_user ID
    75     elseif ( ( true === $current_user_fallback ) && ! empty( $lid ) ) {
     70    } elseif ( ( true === $current_user_fallback ) && ! empty( $lid ) ) {
    7671        $bbp_user_id = $lid;
    7772    }
     
    8176
    8277/**
    83  * Filter the bbPress is_single_user function with BuddyPress eqivalent
     78 * Filter the bbPress is_single_user function with BuddyPress equivalent
    8479 *
    8580 * @since 2.1.0 bbPress (r3552)
     
    9792
    9893/**
    99  * Filter the bbPress is_user_home function with BuddyPress eqivalent
     94 * Filter the bbPress is_user_home function with BuddyPress equivalent
    10095 *
    10196 * @since 2.1.0 bbPress (r3552)
     
    578573    $retval    = (bool) ! empty( $group_ids );
    579574
     575    // Filter & return
    580576    return (bool) apply_filters( 'bbp_is_forum_group_forum', $retval, $forum_id, $group_ids );
    581577}
     
    748744 */
    749745function bbp_get_activity_actions() {
    750     return apply_filters( 'bbp_get_activity_actions', array(
     746
     747    // Filter & return
     748    return (array) apply_filters( 'bbp_get_activity_actions', array(
    751749        'topic' => __( '%1$s started the topic %2$s in the forum %3$s',    'bbpress' ),
    752750        'reply' => __( '%1$s replied to the topic %2$s in the forum %3$s', 'bbpress' )
Note: See TracChangeset for help on using the changeset viewer.