[buddypress-trac] [BuddyPress Trac] #5393: Introduce new filter in bp_get_group_description_excerpt() for setting the excerpt_length

buddypress-trac noreply at wordpress.org
Thu Feb 13 14:21:15 UTC 2014


#5393: Introduce new filter in bp_get_group_description_excerpt()  for setting the
excerpt_length
-------------------------+--------------------
 Reporter:  lenasterg    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  low          |   Milestone:  2.0
Component:  Groups       |     Version:  1.9.2
 Severity:  minor        |  Resolution:
 Keywords:               |
-------------------------+--------------------
Changes (by boonebgorges):

 * milestone:  Awaiting Review => 2.0


Comment:

 I'd rather not set a precedent of creating a specific filter for
 excerpt_length every time we call `bp_create_excerpt()`.

 What we can do to make this easier for you is to pass the $group object
 along to the filter. So then you can do this:

 {{{
 function bbg_custom_group_description_excerpt( $excerpt, $group ) {
     $excerpt = bp_create_excerpt( $group->description, 100 );
 }
 add_filter( 'bp_get_group_description_length',
 'bbg_custom_group_description_excerpt', 10, 2 );
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5393#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list