bp_nouveau_get_members_filters( string $context = '' )

Get Dropdown filters for the members component


Parameters Parameters

$context

(string) (Optional)

Default value: ''


Top ↑

Return Return

(array) the filters


Source Source

File: bp-templates/bp-nouveau/includes/members/functions.php

function bp_nouveau_get_members_filters( $context = '' ) {
	if ( 'group' !== $context ) {
		$filters = array(
			'active' => __( 'Last Active', 'buddypress' ),
			'newest' => __( 'Newest Registered', 'buddypress' ),
		);

		if ( bp_is_active( 'xprofile' ) ) {
			$filters['alphabetical'] = __( 'Alphabetical', 'buddypress' );
		}

		$action = 'bp_members_directory_order_options';

		if ( 'friends' === $context ) {
			$action = 'bp_member_friends_order_options';
		}
	} else {
		$filters = array(
			'last_joined'  => __( 'Newest', 'buddypress' ),
			'first_joined' => __( 'Oldest', 'buddypress' ),
		);

		if ( bp_is_active( 'activity' ) ) {
			$filters['group_activity'] = __( 'Group Activity', 'buddypress' );
		}

		$filters['alphabetical'] = __( 'Alphabetical', 'buddypress' );
		$action                  = 'bp_groups_members_order_options';
	}

	/**
	 * Recommended, filter here instead of adding an action to 'bp_members_directory_order_options'
	 *
	 * @since 3.0.0
	 *
	 * @param array  the members filters.
	 * @param string the context.
	 */
	$filters = apply_filters( 'bp_nouveau_get_members_filters', $filters, $context );

	return bp_nouveau_parse_hooked_options( $action, $filters );
}


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.