Changeset 11027 for trunk/src/bp-groups/classes/class-bp-groups-group.php
- Timestamp:
- 08/22/2016 10:11:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-groups-group.php
r10937 r11027 176 176 177 177 if ( !empty( $id ) ) { 178 $this->id = $id;178 $this->id = (int) $id; 179 179 $this->populate(); 180 180 } … … 209 209 210 210 // Group found so setup the object variables. 211 $this->id = $group->id;212 $this->creator_id = $group->creator_id;211 $this->id = (int) $group->id; 212 $this->creator_id = (int) $group->creator_id; 213 213 $this->name = stripslashes( $group->name ); 214 214 $this->slug = $group->slug; 215 215 $this->description = stripslashes( $group->description ); 216 216 $this->status = $group->status; 217 $this->enable_forum = $group->enable_forum;217 $this->enable_forum = (int) $group->enable_forum; 218 218 $this->date_created = $group->date_created; 219 219 … … 232 232 // Add admins and moderators to their respective arrays. 233 233 foreach ( (array) $admin_mods as $user ) { 234 $user->user_id = (int) $user->user_id; 235 $user->is_admin = (int) $user->is_admin; 236 $user->is_mod = (int) $user->is_mod; 237 234 238 if ( !empty( $user->is_admin ) ) { 235 239 $this->admins[] = $user; … … 242 246 // from the bp_groups cache because it's cached independently. 243 247 $this->last_activity = groups_get_groupmeta( $this->id, 'last_activity' ); 244 $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );248 $this->total_member_count = (int) groups_get_groupmeta( $this->id, 'total_member_count' ); 245 249 246 250 // Set user-specific data. … … 436 440 * @param string|bool $table_name Optional. Name of the table to check 437 441 * against. Default: $bp->groups->table_name. 438 * @return string|null ID of the group, if one is found, else null.442 * @return int|null Group ID if found; null if not. 439 443 */ 440 444 public static function group_exists( $slug, $table_name = false ) { … … 447 451 return false; 448 452 449 return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$table_name} WHERE slug = %s", strtolower( $slug ) ) ); 453 $query = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$table_name} WHERE slug = %s", strtolower( $slug ) ) ); 454 455 return is_numeric( $query ) ? (int) $query : $query; 450 456 } 451 457
Note: See TracChangeset
for help on using the changeset viewer.