bp_get_member_type_directory_link( string $member_type = '' )

Return member type directory link.


Parameters Parameters

$member_type

(string) (Optional) Unique member type identifier as used in bp_register_member_type().

Default value: ''


Top ↑

Return Return

(string)


Source Source

File: bp-members/bp-members-template.php

	function bp_get_member_type_directory_link( $member_type = '' ) {
		if ( empty( $member_type ) ) {
			return '';
		}

		$member_type_object = bp_get_member_type_object( $member_type );

		if ( ! isset( $member_type_object->labels['name'] ) ) {
			return '';
		}

		$member_type_text = $member_type_object->labels['name'];
		if ( isset( $member_type_object->labels['singular_name'] ) && $member_type_object->labels['singular_name'] ) {
			$member_type_text = $member_type_object->labels['singular_name'];
		}

		if ( empty( $member_type_object->has_directory ) ) {
			return esc_html( $member_type_text );
		}

		return sprintf(
			'<a href="%1$s">%2$s</a>',
			esc_url( bp_get_member_type_directory_permalink( $member_type ) ),
			esc_html( $member_type_text )
		);
	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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