diff --git src/bp-core/bp-core-avatars.php src/bp-core/bp-core-avatars.php
index fb74fee..f668067 100644
|
|
function bp_avatar_ajax_upload() { |
990 | 990 | $name_parts = pathinfo( $name ); |
991 | 991 | $name = trim( substr( $name, 0, - ( 1 + strlen( $name_parts['extension'] ) ) ) ); |
992 | 992 | |
993 | | if ( 'user' === $bp_params['object'] ) { |
994 | | do_action( 'xprofile_avatar_uploaded' ); |
995 | | } |
996 | | |
997 | 993 | // Finally return the avatar to the editor |
998 | 994 | bp_attachments_json_response( true, $is_html4, array( |
999 | 995 | 'name' => $name, |
… |
… |
function bp_avatar_handle_capture( $data = '', $item_id = 0 ) { |
1056 | 1052 | // Crop to default values |
1057 | 1053 | $crop_args = array( 'item_id' => $item_id, 'original_file' => $avatar_to_crop, 'crop_x' => 0, 'crop_y' => 0 ); |
1058 | 1054 | |
1059 | | /** |
1060 | | * Fires if the new avatar was successfully captured. |
1061 | | * |
1062 | | * @since BuddyPress (2.3.0) |
1063 | | */ |
1064 | | do_action( 'xprofile_avatar_uploaded' ); |
1065 | | |
1066 | 1055 | return bp_core_avatar_handle_crop( $crop_args ); |
1067 | 1056 | } else { |
1068 | 1057 | return false; |
… |
… |
function bp_avatar_ajax_set() { |
1199 | 1188 | 'item_id' => $avatar_data['item_id'], |
1200 | 1189 | ); |
1201 | 1190 | |
1202 | | do_action( 'xprofile_screen_change_avatar' ); |
| 1191 | /** |
| 1192 | * Fires if the new avatar was successfully captured. |
| 1193 | * |
| 1194 | * @since 1.1.0 Used to inform the avatar was successfully cropped |
| 1195 | * @since 2.3.4 Add a new parameter to inform about the way the avatar was set. |
| 1196 | * eg: 'crop' or 'camera' |
| 1197 | * Move the action at the right place, once the avatar is set |
| 1198 | * |
| 1199 | * @param string $type Inform about the way the avatar was set ('camera') |
| 1200 | */ |
| 1201 | do_action( 'xprofile_avatar_uploaded', $avatar_data['type'] ); |
1203 | 1202 | |
1204 | 1203 | wp_send_json_success( $return ); |
1205 | 1204 | } |
… |
… |
function bp_avatar_ajax_set() { |
1244 | 1243 | ); |
1245 | 1244 | |
1246 | 1245 | if ( 'user' === $avatar_data['object'] ) { |
1247 | | do_action( 'xprofile_screen_change_avatar' ); |
| 1246 | /** |
| 1247 | * Fires if the new avatar was successfully cropped. |
| 1248 | * |
| 1249 | * @since 1.1.0 Used to inform the avatar was successfully cropped |
| 1250 | * @since 2.3.4 Add a new parameter to inform about the way the avatar was set. |
| 1251 | * eg: 'crop' or 'camera' |
| 1252 | * Move the action at the right place, once the avatar is set |
| 1253 | * |
| 1254 | * @param string $type Inform about the way the avatar was set ('crop') |
| 1255 | */ |
| 1256 | do_action( 'xprofile_avatar_uploaded', $avatar_data['type'] ); |
1248 | 1257 | } |
1249 | 1258 | |
1250 | 1259 | wp_send_json_success( $return ); |