Changeset 5961
- Timestamp:
- 04/06/2012 10:44:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-classes.php
r5926 r5961 45 45 $this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id ); 46 46 47 do_action_ref_array( 'xprofile_group_before_save', array( $this ) );48 49 if ( !empty( $this->id ))47 do_action_ref_array( 'xprofile_group_before_save', array( &$this ) ); 48 49 if ( $this->id ) 50 50 $sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id ); 51 51 else … … 55 55 return false; 56 56 57 do_action_ref_array( 'xprofile_group_after_save', array( $this ) ); 58 59 if ( !empty( $this->id ) ) 60 return $this->id; 61 else 62 return $wpdb->insert_id; 57 // If not set, update the ID in the group object 58 if ( ! $this->id ) 59 $this->id = $wpdb->insert_id; 60 61 do_action_ref_array( 'xprofile_group_after_save', array( &$this ) ); 62 63 return $this->id; 63 64 } 64 65
Note: See TracChangeset
for help on using the changeset viewer.