Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/19/2012 02:22:00 PM (15 years ago)
Author:
boonebgorges
Message:

Deprecates groups_check_group_exists() in favor of more aptly named groups_get_id(). Fixes #4023

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-functions.php

    r5729 r5808  
    258258}
    259259
     260/**
     261 * Get a group slug by its ID
     262 *
     263 * @param int $group_id The numeric ID of the group
     264 * @return string The group's slug
     265 */
    260266function groups_get_slug( $group_id ) {
    261267        $group = groups_get_group( array( 'group_id' => $group_id ) );
    262         return $group->slug;
     268        return !empty( $group->slug ) ? $group->slug : '';
     269}
     270
     271/**
     272 * Get a group ID by its slug
     273 *
     274 * @since 1.6
     275 *
     276 * @param string $group_slug The group's slug
     277 * @return int The ID
     278 */
     279function groups_get_id( $group_slug ) {
     280        return (int)BP_Groups_Group::group_exists( $group_slug );
    263281}
    264282
     
    359377
    360378/*** General Group Functions ****************************************************/
    361 
    362 function groups_check_group_exists( $group_id ) {
    363         return BP_Groups_Group::group_exists( $group_id );
    364 }
    365379
    366380function groups_get_group_admins( $group_id ) {
Note: See TracChangeset for help on using the changeset viewer.