Changeset 1351 for trunk/bp-xprofile/bp-xprofile-classes.php
- Timestamp:
- 04/19/2009 12:21:53 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-xprofile/bp-xprofile-classes.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-classes.php
r1311 r1351 46 46 global $wpdb, $bp; 47 47 48 $this->name = wp_filter_kses( $this->name ); 49 $this->description = wp_filter_kses( $this->description ); 50 51 if ( $this->id != null ) { 52 $sql = $wpdb->prepare("UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id); 53 } else { 54 $sql = $wpdb->prepare("INSERT INTO {$bp->profile->table_name_groups} (name, description, can_delete) VALUES (%s, %s, 1)", $this->name, $this->description); 48 $this->name = apply_filters( 'xprofile_group_name_before_save', $this->name, $this->id ); 49 $this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id ); 50 51 do_action( 'xprofile_group_before_save', $this ); 52 53 if ( $this->id ) { 54 $sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id ); 55 } else { 56 $sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_groups} (name, description, can_delete) VALUES (%s, %s, 1)", $this->name, $this->description ); 55 57 } 56 58 57 59 if ( !$wpdb->query($sql) ) 58 60 return false; 61 62 do_action( 'xprofile_group_after_save', $this ); 59 63 60 64 return true; … … 246 250 global $wpdb, $bp; 247 251 248 $this->name = wp_filter_kses( $this->name ); 249 $this->desc = wp_filter_kses( $this->desc ); 252 $error = false; 253 254 $this->group_id = apply_filters( 'xprofile_field_group_id_before_save', $this->group_id, $this->id ); 255 $this->parent_id = apply_filters( 'xprofile_field_parent_id_before_save', $this->parent_id, $this->id ); 256 $this->type = apply_filters( 'xprofile_field_type_before_save', $this->type, $this->id ); 257 $this->name = apply_filters( 'xprofile_field_name_before_save', $this->name, $this->id ); 258 $this->desc = apply_filters( 'xprofile_field_description_before_save', $this->desc, $this->id ); 259 $this->is_required = apply_filters( 'xprofile_field_is_required_before_save', $this->is_required, $this->id ); 260 $this->is_public = apply_filters( 'xprofile_field_is_public_before_save', $this->is_public, $this->id ); 261 $this->order_by = apply_filters( 'xprofile_field_order_by_before_save', $this->order_by, $this->id ); 262 263 do_action( 'xprofile_field_before_save', $this ); 250 264 251 265 if ( $this->id != null ) { … … 354 368 } 355 369 } 356 357 return true;358 359 } else {360 return true;361 370 } 362 } 363 else 364 { 371 } else { 372 $error = true; 373 } 374 375 if ( !$error ) { 376 do_action( 'xprofile_field_after_save', $this ); 377 return true; 378 } else { 365 379 return false; 366 380 } … … 1039 1053 function save() { 1040 1054 global $wpdb, $bp; 1041 1042 $this->last_updated = date( 'Y-m-d H:i:s' ); 1043 $this->value = wp_filter_kses( $this->value ); 1044 1055 1056 $this->user_id = apply_filters( 'xprofile_data_user_id_before_save', $this->user_id, $this->id ); 1057 $this->field_id = apply_filters( 'xprofile_data_field_id_before_save', $this->field_id, $this->id ); 1058 $this->value = apply_filters( 'xprofile_data_value_before_save', $this->value, $this->id ); 1059 $this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', date( 'Y-m-d H:i:s' ), $this->id ); 1060 1061 do_action( 'xprofile_data_before_save', $this ); 1062 1045 1063 if ( $this->is_valid_field() ) { 1046 1064 if ( $this->exists() && $this->value != '' ) { … … 1056 1074 return false; 1057 1075 1076 do_action( 'xprofile_data_after_save', $this ); 1077 1058 1078 return true; 1059 1079 }
Note: See TracChangeset
for help on using the changeset viewer.