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/users/capabilities.php

    r6384 r6438  
    118118    }
    119119
    120     return apply_filters( 'bbp_map_primary_meta_caps', $caps, $cap, $user_id, $args );
     120    // Filter & return
     121    return (array) apply_filters( 'bbp_map_primary_meta_caps', $caps, $cap, $user_id, $args );
    121122}
    122123
     
    167168    }
    168169
     170    // Filter & return
    169171    return apply_filters( 'bbp_set_user_role', $new_role, $user_id, $user );
    170172}
     
    205207    }
    206208
     209    // Filter & return
    207210    return apply_filters( 'bbp_get_user_role', $role, $user_id, $user );
    208211}
     
    243246    }
    244247
     248    // Filter & return
    245249    return apply_filters( 'bbp_get_user_blog_role', $role, $user_id, $user );
    246250}
     
    393397    $default_role = bbp_get_default_role();
    394398
    395     // Return filtered results, forcing admins to keymasters.
     399    // Filter & return
    396400    return (array) apply_filters( 'bbp_get_user_role_map', array (
    397401        'administrator' => bbp_get_keymaster_role(),
     
    440444    }
    441445
     446    // Filter & return
    442447    return (bool) apply_filters( 'bbp_core_is_user_spammer', $is_spammer );
    443448}
     
    661666    }
    662667
     668    // Filter & return
    663669    return (bool) apply_filters( 'bbp_core_is_user_deleted', $is_deleted );
    664670}
     
    744750    $_user_id = (int) ! empty( $user_id ) ? $user_id : bbp_get_current_user_id();
    745751
    746     // Filter and return
     752    // Filter & return
    747753    return (bool) apply_filters( 'bbp_is_user_keymaster', user_can( $_user_id, 'keep_gate' ), $_user_id, $user_id );
    748754}
     
    783789    }
    784790
    785     // Filter and return
     791    // Filter & return
    786792    return (bool) apply_filters( 'bbp_show_user_profile', $retval, $user_id );
    787793}
     
    855861    }
    856862
    857     return apply_filters( 'bbp_get_moderators', $users, $object_id );
    858 }
     863    // Filter & return
     864    return (array) apply_filters( 'bbp_get_moderators', $users, $object_id );
     865}
Note: See TracChangeset for help on using the changeset viewer.