BP_Members_Admin::users_table_populate_type_cell( string $retval = '', string $column_name = '', int $user_id )

Return member’s type for display in the WP admin users list table.

Description

Parameters

$retval

(string) (Optional)

Default value: ''

$column_name

(string) (Optional)

Default value: ''

$user_id

(int) (Required)

Return

(string) profile type as a link to filter all users.

Source

File: bp-members/classes/class-bp-members-admin.php

	public function users_table_populate_type_cell( $retval = '', $column_name = '', $user_id = 0 ) {
		// Only looking for profile type column.
		if ( bp_get_member_type_tax_name() !== $column_name ) {
			return $retval;
		}

		// Get the profile type.
		$type = bp_get_member_type( $user_id );

		// Output the profile type link.
		if ( $type_obj = bp_get_member_type_object( $type ) ) {
			$url = add_query_arg( array( 'bp-member-type' => urlencode( $type ) ) );
			$retval = '<a href="' . esc_url( $url ) . '">' . esc_html( $type_obj->labels['singular_name'] ) . '</a>';
		}

		return $retval;
	}

Changelog

Changelog
Version Description
BuddyPress 2.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.