Skip to:
Content

Changeset 11531


Ignore:
Timestamp:
04/15/2017 09:12:41 AM (15 months ago)
Author:
hnla
Message:

Update bp_group_description_excerpt() to take a $length param

bp_create_excerpt() excepts a $length param however the group desc excerpt function does not pass this param only $group.

Commit adds the $length param to function, ensuring passed order is preserved (this param will be used in Nouveau for group grid layouts).

Fixes #7493
Props hnla, dcavins

File:
1 edited

Legend:

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

    r11530 r11531  
    12091209 * @since 1.0.0
    12101210 *
    1211  * @param object|bool $group Optional. The group being referenced.
    1212  *                           Defaults to the group currently being
    1213  *                           iterated on in the groups loop.
    1214  */
    1215 function bp_group_description_excerpt( $group = false ) {
    1216     echo bp_get_group_description_excerpt( $group );
     1211 * @param object|bool $group  Optional. The group being referenced.
     1212 *                            Defaults to the group currently being
     1213 *                            iterated on in the groups loop.
     1214 * @param int         $length Optional. Length of returned string, including ellipsis.
     1215 *                            Default: 225.
     1216 */
     1217function bp_group_description_excerpt( $group = false, $length = false ) {
     1218    echo bp_get_group_description_excerpt( $group, $length );
    12171219}
    12181220    /**
     
    12211223     * @since 1.0.0
    12221224     *
    1223      * @param object|bool $group Optional. The group being referenced.
    1224      *                           Defaults to the group currently being
    1225      *                           iterated on in the groups loop.
     1225     * @param object|bool $group  Optional. The group being referenced.
     1226     *                            Defaults to the group currently being
     1227     *                            iterated on in the groups loop.
     1228     * @param int         $length Optional. Length of returned string, including ellipsis.
     1229     *                            Default: 225.
    12261230     * @return string Excerpt.
    12271231     */
    1228     function bp_get_group_description_excerpt( $group = false ) {
     1232    function bp_get_group_description_excerpt( $group = false, $length = false ) {
    12291233        global $groups_template;
    12301234
     
    12411245         * @param object $group Object for group whose description is made into an excerpt.
    12421246         */
    1243         return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ), $group );
     1247        return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description, $length ), $group );
    12441248    }
    12451249
Note: See TracChangeset for help on using the changeset viewer.