Changeset 9678
- Timestamp:
- 04/02/2015 12:15:18 AM (10 years ago)
- Location:
- trunk/src/bp-xprofile
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-admin.php
r9673 r9678 230 230 global $message, $type; 231 231 232 // Get the field group 232 233 $group = new BP_XProfile_Group( $group_id ); 233 234 235 // Updating 234 236 if ( isset( $_POST['save_group'] ) ) { 235 if ( BP_XProfile_Group::admin_validate( $_POST ) ) { 236 $group->name = wp_filter_kses( $_POST['group_name'] ); 237 $group->description = !empty( $_POST['group_description'] ) ? wp_filter_kses( $_POST['group_description'] ) : ''; 238 239 if ( !$group->save() ) { 237 238 // Validate $_POSTed data 239 if ( BP_XProfile_Group::admin_validate() ) { 240 241 // Set the group name 242 $group->name = $_POST['group_name']; 243 244 // Set the group description 245 if ( ! empty( $_POST['group_description'] ) ) { 246 $group->description = $_POST['group_description']; 247 } else { 248 $group->description = ''; 249 } 250 251 // Attempt to save the field group 252 if ( false === $group->save() ) { 240 253 $message = __( 'There was an error saving the group. Please try again.', 'buddypress' ); 241 254 $type = 'error'; 255 256 // Save successful 242 257 } else { 243 258 $message = __( 'The group was saved successfully.', 'buddypress' ); 244 259 $type = 'success'; 245 260 261 // @todo remove these old options 246 262 if ( 1 == $group_id ) { 247 263 bp_update_option( 'bp-xprofile-base-group-name', $group->name ); -
trunk/src/bp-xprofile/bp-xprofile-filters.php
r9351 r9678 56 56 add_filter( 'xprofile_filtered_data_value_before_save', 'trim', 2 ); 57 57 58 // Save filters 59 add_filter( 'xprofile_group_name_before_save', 'wp_filter_kses' ); 60 add_filter( 'xprofile_group_description_before_save', 'wp_filter_kses' ); 61 58 62 /** 59 63 * xprofile_filter_kses ( $content ) -
trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php
r9677 r9678 114 114 global $wpdb; 115 115 116 // Filter the field group attributes 116 117 $this->name = apply_filters( 'xprofile_group_name_before_save', $this->name, $this->id ); 117 118 $this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id );
Note: See TracChangeset
for help on using the changeset viewer.