bp_get_group_type_directory_permalink( string $group_type = '' )

Return group type directory permalink.

Description

Parameters

$group_type

(string) (Optional) Group type. Defaults to current group type.

Default value: ''

Return

(string) Group type directory URL on success, an empty string on failure.

Source

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

	function bp_get_group_type_directory_permalink( $group_type = '' ) {

		if ( $group_type ) {
			$_group_type = $group_type;
		} else {
			// Fall back on the current group type.
			$_group_type = bp_get_current_group_directory_type();
		}

		$type = bp_groups_get_group_type_object( $_group_type );

		// Bail when profile type is not found or has no directory.
		if ( ! $type || ! $type->has_directory ) {
			return '';
		}

		/**
		 * Filters the group type directory permalink.
		 *
		 * @since BuddyPress 2.7.0
		 *
		 * @param string $value       Group type directory permalink.
		 * @param object $type        Group type object.
		 * @param string $member_type Group type name, as passed to the function.
		 */
		return apply_filters( 'bp_get_group_type_directory_permalink', trailingslashit( bp_get_groups_directory_permalink() . bp_get_groups_group_type_base() . '/' . $type->directory_slug ), $type, $group_type );
	}

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.