Skip to:
Content

BuddyPress.org

Ticket #6997: 6997-bp-groups-template.patch

File 6997-bp-groups-template.patch, 6.8 KB (added by Offereins, 9 years ago)

Filter updates for bp-groups-template.php

  • src/bp-groups/bp-groups-template.php

    diff --git a/src/bp-groups/bp-groups-template.php b/src/bp-groups/bp-groups-template.php
    index 10feea0..41425c9 100644
    a b function bp_group_creator_avatar( $group = false, $args = array() ) { 
    12971297                 *
    12981298                 * @since 1.7.0
    12991299                 * @since 2.5.0 Added the `$group` parameter.
     1300                 * @since 2.6.0 Added the `$r` parameter.
    13001301                 *
    13011302                 * @param string $avatar Avatar of the group creator.
    13021303                 * @param object $group  Group object.
     1304                 * @param array  $r      Array of parsed arguments.
    13031305                 */
    1304                 return apply_filters( 'bp_get_group_creator_avatar', $avatar, $group );
     1306                return apply_filters( 'bp_get_group_creator_avatar', $avatar, $group, $r );
    13051307        }
    13061308
    13071309/**
    function bp_group_member_promote_mod_link( $args = '' ) { 
    23602362                 * Filters a URL for promoting a user to moderator.
    23612363                 *
    23622364                 * @since 1.1.0
     2365                 * @since 2.6.0 Added the `$r` parameter.
    23632366                 *
    23642367                 * @param string $value URL to use for promoting a user to moderator.
     2368                 * @param array  $r     Array of parsed arguments.
    23652369                 */
    2366                 return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ) );
     2370                return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ), $r );
    23672371        }
    23682372
    23692373/**
    function bp_group_member_promote_admin_link( $args = '' ) { 
    24032407                 * Filters a URL for promoting a user to admin.
    24042408                 *
    24052409                 * @since 1.1.0
     2410                 * @since 2.6.0 Added the `$r` parameter.
    24062411                 *
    24072412                 * @param string $value URL to use for promoting a user to admin.
     2413                 * @param array  $r     Array of parsed arguments.
    24082414                 */
    2409                 return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/admin/' . $user_id, 'groups_promote_member' ) );
     2415                return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/admin/' . $user_id, 'groups_promote_member' ), $r );
    24102416        }
    24112417
    24122418/**
    function bp_group_member_demote_link( $user_id = 0 ) { 
    24522458                 *
    24532459                 * @since 1.0.0
    24542460                 * @since 2.5.0 Added the `$group` parameter.
     2461                 * @since 2.6.0 Added the `$user_id` parameter.
    24552462                 *
    2456                  * @param string $value URL to use for demoting a user to member.
    2457                  * @param object $group Group object.
     2463                 * @param string $value   URL to use for demoting a user to member.
     2464                 * @param object $group   Group object.
     2465                 * @param int    $user_id ID of the member to demote.
    24582466                 */
    2459                 return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id, 'groups_demote_member' ), $group );
     2467                return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id, 'groups_demote_member' ), $group, $user_id );
    24602468        }
    24612469
    24622470/**
    function bp_group_member_ban_link( $user_id = 0 ) { 
    24972505                 * Filters a URL for banning a member from a group.
    24982506                 *
    24992507                 * @since 1.0.0
     2508                 * @since 2.6.0 Added the `$group` and `$user_id` parameters.
    25002509                 *
    2501                  * @param string $value URL to use for banning a member.
     2510                 * @param string $value   URL to use for banning a member.
     2511                 * @param object $group   Group object.
     2512                 * @param int    $user_id ID of the member to ban.
    25022513                 */
    2503                 return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/ban/' . $user_id, 'groups_ban_member' ) );
     2514                return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/ban/' . $user_id, 'groups_ban_member' ), $group, $user_id );
    25042515        }
    25052516
    25062517/**
    function bp_group_member_unban_link( $user_id = 0 ) { 
    25452556                 * Filters a URL for unbanning a member from a group.
    25462557                 *
    25472558                 * @since 1.0.0
     2559                 * @since 2.6.0 Added the `$group` and `$user_id` parameters.
    25482560                 *
    25492561                 * @param string $value URL to use for unbanning a member.
     2562                 * @param object $group   Group object.
     2563                 * @param int    $user_id ID of the member to unban.
    25502564                 */
    2551                 return apply_filters( 'bp_get_group_member_unban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/unban/' . $user_id, 'groups_unban_member' ) );
     2565                return apply_filters( 'bp_get_group_member_unban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/unban/' . $user_id, 'groups_unban_member' ), $group, $user_id );
    25522566        }
    25532567
    25542568/**
    function bp_group_member_remove_link( $user_id = 0 ) { 
    25902604                 *
    25912605                 * @since 1.2.6
    25922606                 * @since 2.5.0 Added the `$group` parameter.
     2607                 * @since 2.6.0 Added the `$user_id` parameter.
    25932608                 *
    25942609                 * @param string $value URL to use for removing a member.
    25952610                 * @param object $group Group object.
     2611                 * @param int    $user_id ID of the member to remove.
    25962612                 */
    2597                 return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id, 'groups_remove_member' ), $group );
     2613                return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id, 'groups_remove_member' ), $group, $user_id );
    25982614        }
    25992615
    26002616/**
    function bp_group_is_user_banned( $group = false, $user_id = 0 ) { 
    29102926         *
    29112927         * @since 1.5.0
    29122928         * @since 2.5.0 Added the `$group` parameter.
     2929         * @since 2.6.0 Added the `$user_id` parameter.
    29132930         *
    29142931         * @param bool   $is_invited If user has been from current group.
    29152932         * @param object $group      Group object.
     2933         * @param int    $user_id    ID of the user that is banned.
    29162934         */
    2917         return (bool) apply_filters( 'bp_group_is_user_banned', $retval, $group );
     2935        return (bool) apply_filters( 'bp_group_is_user_banned', $retval, $group, $user_id );
    29182936}
    29192937
    29202938/**
    function bp_group_join_button( $group = false ) { 
    33263344                 * Filters the HTML button for joining a group.
    33273345                 *
    33283346                 * @since 1.2.6
    3329                  * @since 2.4.0 Added $group parameter to filter args.
     3347                 * @since 2.4.0 Added the `$group` parameter.
    33303348                 *
    33313349                 * @param string $button HTML button for joining a group.
    33323350                 * @param object $group BuddyPress group object
    function bp_group_current_avatar( $type = 'thumb' ) { 
    51275145                 * Filters the current group avatar.
    51285146                 *
    51295147                 * @since 2.0.0
     5148                 * @since 2.6.0 Added the `$type` parameter.
    51305149                 *
    51315150                 * @param string $group_avatar HTML markup for current group avatar.
     5151                 * @param string $type         Thumb or full.
    51325152                 */
    5133                 return apply_filters( 'bp_get_group_current_avatar', $group_avatar );
     5153                return apply_filters( 'bp_get_group_current_avatar', $group_avatar, $type );
    51345154        }
    51355155
    51365156/**