IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 358 | 358 | |
| 359 | 359 | // If the image cropping is done, crop the image and save a full/thumb version. |
| 360 | 360 | if ( isset( $_POST['avatar-crop-submit'] ) && isset( $_POST['upload'] ) ) { |
| | 361 | |
| 361 | 362 | // Normally we would check a nonce here, but the group save nonce is used instead. |
| 362 | | if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) ) |
| | 363 | $args = array( |
| | 364 | 'object' => 'group', |
| | 365 | 'avatar_dir' => 'group-avatars', |
| | 366 | 'item_id' => $bp->groups->current_group->id, |
| | 367 | 'original_file' => $_POST['image_src'], |
| | 368 | 'crop_x' => $_POST['x'], |
| | 369 | 'crop_y' => $_POST['y'], |
| | 370 | 'crop_w' => $_POST['w'], |
| | 371 | 'crop_h' => $_POST['h'] |
| | 372 | ); |
| | 373 | |
| | 374 | if ( !bp_core_avatar_handle_crop( $args ) ) { |
| 363 | 375 | bp_core_add_message( __( 'There was an error saving the group profile photo, please try uploading again.', 'buddypress' ), 'error' ); |
| 364 | | else |
| | 376 | } else { |
| | 377 | /** |
| | 378 | * Fires after a group avatar is uploaded. |
| | 379 | * |
| | 380 | * @since 2.8.0 |
| | 381 | * |
| | 382 | * @param int $group_id ID of the group. |
| | 383 | * @param string $type Avatar type. 'crop' or 'full'. |
| | 384 | * @param array $args Array of parameters passed to the avatar handler. |
| | 385 | */ |
| | 386 | do_action( 'groups_avatar_uploaded', bp_get_current_group_id(), 'crop', $args ); |
| 365 | 387 | bp_core_add_message( __( 'The group profile photo was uploaded successfully.', 'buddypress' ) ); |
| | 388 | } |
| 366 | 389 | } |
| 367 | 390 | } |
| 368 | 391 | |
| … |
… |
|
| 595 | 618 | $cgroup->save(); |
| 596 | 619 | } |
| 597 | 620 | } |
| 598 | | add_action( 'bp_groups_delete_group', 'bp_groups_update_orphaned_groups_on_group_delete', 10, 2 ); |
| 599 | | No newline at end of file |
| | 621 | add_action( 'bp_groups_delete_group', 'bp_groups_update_orphaned_groups_on_group_delete', 10, 2 ); |