Skip to:
Content

BuddyPress.org

Changeset 7865


Ignore:
Timestamp:
02/13/2014 02:22:03 PM (11 years ago)
Author:
boonebgorges
Message:

Pass $group object to bp_get_group_description_excerpt filter

This allows theme/plugin authors to more easily customize excerpts.

Fixes #5393

File:
1 edited

Legend:

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

    r7829 r7865  
    620620    }
    621621
     622/**
     623 * Output an excerpt of the group description.
     624 *
     625 * @param object $group Optional. The group being referenced. Defaults to the
     626 *        group currently being iterated on in the groups loop.
     627 */
    622628function bp_group_description_excerpt( $group = false ) {
    623629    echo bp_get_group_description_excerpt( $group );
    624630}
     631    /**
     632     * Get an excerpt of a group description.
     633     *
     634     * @param object $group Optional. The group being referenced. Defaults
     635     *        to the group currently being iterated on in the groups loop.
     636     * @return string Excerpt.
     637     */
    625638    function bp_get_group_description_excerpt( $group = false ) {
    626639        global $groups_template;
    627640
    628         if ( empty( $group ) )
    629             $group =& $groups_template->group;
    630 
    631         return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ) );
     641        if ( empty( $group ) ) {
     642            $group =& $groups_template->group;
     643        }
     644
     645        return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ), $group );
    632646    }
    633647
Note: See TracChangeset for help on using the changeset viewer.