BP_Groups_Group::get_slug( int $group_id )

Get the slug for a given group ID.

Description

Parameters

$group_id

(int) (Required) ID of the group.

Return

(string|null) The slug, if found. Otherwise null.

Source

File: bp-groups/classes/class-bp-groups-group.php

	public static function get_slug( $group_id ) {
		global $wpdb;

		$bp = buddypress();

		return $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM {$bp->groups->table_name} WHERE id = %d", $group_id ) );
	}

Changelog

Changelog
Version Description
BuddyPress 1.6.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.