Skip to:
Content

BuddyPress.org

Changeset 5808


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

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/deprecated/1.6.php

    r5657 r5808  
    8888
    8989/**
     90 * Groups functions
     91 */
     92
     93/**
     94 * @deprecated 1.6
     95 * @deprecated Renamed to groups_get_id() for greater consistency
     96 */
     97function groups_check_group_exists( $group_slug ) {
     98    _deprecated_function( __FUNCTION__, '1.6', 'groups_get_id()' );
     99    return groups_get_id( $group_slug );
     100}
     101
     102/**
    90103 * Activity functions
    91104 */
  • 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.