Skip to:
Content

BuddyPress.org

Ticket #7371: 7371.diff

File 7371.diff, 1.5 KB (added by boonebgorges, 5 years ago)
  • src/bp-core/bp-core-avatars.php

    diff --git src/bp-core/bp-core-avatars.php src/bp-core/bp-core-avatars.php
    index c606a34..ca36325 100644
    function bp_avatar_ajax_set() { 
    13541354                         * @param string $type Inform about the way the avatar was set ('crop')
    13551355                         */
    13561356                        do_action( 'xprofile_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'] );
     1357                } elseif ( 'group' === $avatar_data['object'] ) {
     1358                        /** This action is documented in bp-groups/bp-groups-screens.php */
     1359                        do_action( 'groups_avatar_uploaded', (int) $avatar_data['item_id'], $atavar_data['type'] );
    13571360                }
    13581361
    13591362                wp_send_json_success( $return );
  • src/bp-groups/bp-groups-screens.php

    diff --git src/bp-groups/bp-groups-screens.php src/bp-groups/bp-groups-screens.php
    index 46b654f..0ec6abc 100644
    function groups_screen_group_admin_avatar() { 
    10651065                if ( !bp_core_avatar_handle_crop( $args ) ) {
    10661066                        bp_core_add_message( __( 'There was a problem cropping the group profile photo.', 'buddypress' ), 'error' );
    10671067                } else {
     1068                        /**
     1069                         * Fires after a group avatar is uploaded.
     1070                         *
     1071                         * @since 2.8.0
     1072                         *
     1073                         * @param int    $group_id ID of the group.
     1074                         * @param string $type     Avatar type. 'crop' or 'full'.
     1075                         */
     1076                        do_action( 'groups_avatar_uploaded', bp_get_current_group_id(), 'crop' );
     1077
    10681078                        bp_core_add_message( __( 'The new group profile photo was uploaded successfully.', 'buddypress' ) );
    10691079                }
    10701080        }