bp_get_member_type_directory_permalink( string $member_type = '' )
Return profile type directory permalink.
Description
Parameters
- $member_type
-
(Optional) profile type. Defaults to current profile type.
Default value: ''
Return
(string) profile type directory URL on success, an empty string on failure.
Source
File: bp-members/bp-members-template.php
function bp_get_member_type_directory_permalink( $member_type = '' ) {
if ( $member_type ) {
$_member_type = $member_type;
} else {
// Fall back on the current profile type.
$_member_type = bp_get_current_member_type();
}
$type = bp_get_member_type_object( $_member_type );
// Bail when profile type is not found or has no directory.
if ( ! $type || ! $type->has_directory ) {
return '';
}
/**
* Filters the profile type directory permalink.
*
* @since BuddyPress 2.5.0
*
* @param string $value profile type directory permalink.
* @param object $type profile type object.
* @param string $member_type profile type name, as passed to the function.
*/
return apply_filters( 'bp_get_member_type_directory_permalink', trailingslashit( bp_get_members_directory_permalink() . bp_get_members_member_type_base() . '/' . $type->directory_slug ), $type, $member_type );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.5.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.