bp_nouveau_get_group_description_excerpt( object $group = null, int $length = null )

Filters the excerpt of a group description.


Description Description

Checks if the group loop is set as a ‘Grid’ layout and returns a reduced excerpt.


Top ↑

Parameters Parameters

$group

(object) (Optional) The group being referenced. Defaults to the group currently being iterated on in the groups loop.

Default value: null

$length

(int) (Optional) Length of returned string, including ellipsis. Default: 100.

Default value: null


Top ↑

Return Return

(string) Excerpt.


Source Source

File: bp-templates/bp-nouveau/includes/groups/template-tags.php

function bp_nouveau_get_group_description_excerpt( $group = null, $length = null ) {
	global $groups_template;

	if ( ! $group ) {
		$group =& $groups_template->group;
	}

	/**
	 * If this is a grid layout but no length is passed in set a shorter
	 * default value otherwise use the passed in value.
	 * If not a grid then the BP core default is used or passed in value.
	 */
	if ( bp_nouveau_loop_is_grid() && 'groups' === bp_current_component() ) {
		if ( ! $length ) {
			$length = 100;
		} else {
			$length = $length;
		}
	}

	/**
	 * Filters the excerpt of a group description.
	 *
	 * @since 3.0.0
	 *
	 * @param string $value Excerpt of a group description.
	 * @param object $group Object for group whose description is made into an excerpt.
	 */
	return apply_filters( 'bp_nouveau_get_group_description_excerpt', bp_create_excerpt( $group->description, $length ), $group );
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.