Skip to:
Content

BuddyPress.org

Changeset 8752


Ignore:
Timestamp:
08/03/2014 02:26:38 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Clean up bp_get_group_avatar_thumb() and bp_get_group_avatar_mini() functions:

  • Actually allow usage of $group parameter if passed
  • Use array over query string
  • Add phpdoc blocks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r8751 r8752  
    608608    }
    609609
     610/**
     611 * Output the group avatar thumbnail while in the groups loop.
     612 *
     613 * @since BuddyPress (1.0.0)
     614 *
     615 * @param object $group Single group object
     616 */
    610617function bp_group_avatar_thumb( $group = false ) {
    611618    echo bp_get_group_avatar_thumb( $group );
    612619}
     620    /**
     621     * Return the group avatar thumbnail while in the groups loop.
     622     *
     623     * @since BuddyPress (1.0.0)
     624     *
     625     * @param object $group Single group object
     626     */
    613627    function bp_get_group_avatar_thumb( $group = false ) {
    614         return bp_get_group_avatar( 'type=thumb' );
    615     }
    616 
     628        return bp_get_group_avatar( array(
     629            'type' => 'thumb',
     630            'id'   => ! empty( $group->id ) ? $group->id : false
     631        ) );
     632    }
     633
     634/**
     635 * Output the miniature group avatar thumbnail while in the groups loop.
     636 *
     637 * @since BuddyPress (1.0.0)
     638 *
     639 * @param object $group Single group object
     640 */
    617641function bp_group_avatar_mini( $group = false ) {
    618642    echo bp_get_group_avatar_mini( $group );
    619643}
     644    /**
     645     * Return the miniature group avatar thumbnail while in the groups loop.
     646     *
     647     * @since BuddyPress (1.0.0)
     648     *
     649     * @param object $group Single group object
     650     */
    620651    function bp_get_group_avatar_mini( $group = false ) {
    621         return bp_get_group_avatar( 'type=thumb&width=30&height=30' );
     652        return bp_get_group_avatar( array(
     653            'type'   => 'thumb',
     654            'width'  => 30,
     655            'height' => 30,
     656            'id'     => ! empty( $group->id ) ? $group->id : false
     657        ) );
    622658    }
    623659
Note: See TracChangeset for help on using the changeset viewer.