Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/29/2020 03:38:06 PM (16 months ago)
Author:
imath
Message:

Move Avatars & Cover from xProfile to Members component : step 3

Move the Avatar upload directory filter from the xProfile functions to the Members functions.
Move the Avatar template functions from xProfile to the Members component.

See #8156

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-avatars.php

    r12536 r12555  
    10061006    $needs_reset = array();
    10071007
    1008     if ( 'user' === $bp_params['object'] && bp_is_active( 'xprofile' ) ) {
    1009         $bp_params['upload_dir_filter'] = 'xprofile_avatar_upload_dir';
     1008    if ( 'user' === $bp_params['object'] && bp_is_active( 'members' ) ) {
     1009        $bp_params['upload_dir_filter'] = 'bp_members_avatar_upload_dir';
    10101010
    10111011        if ( ! bp_displayed_user_id() && ! empty( $bp_params['item_id'] ) ) {
     
    12981298            );
    12991299
     1300            /** This action is documented in wp-includes/deprecated.php */
     1301            do_action_deprecated( 'xprofile_avatar_uploaded', array( (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data ), '6.0.0', 'bp_members_avatar_uploaded' );
     1302
    13001303            /**
    13011304             * Fires if the new avatar was successfully captured.
    13021305             *
    1303              * @since 1.1.0 Used to inform the avatar was successfully cropped
    1304              * @since 2.3.4 Add two new parameters to inform about the user id and
    1305              *              about the way the avatar was set (eg: 'crop' or 'camera')
    1306              *              Move the action at the right place, once the avatar is set
    1307              * @since 2.8.0 Added the `$avatar_data` parameter.
     1306             * @since 6.0.0
    13081307             *
    13091308             * @param string $item_id     Inform about the user id the avatar was set for.
     
    13111310             * @param array  $avatar_data Array of parameters passed to the avatar handler.
    13121311             */
    1313             do_action( 'xprofile_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data );
     1312            do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data );
    13141313
    13151314            wp_send_json_success( $return );
     
    13561355
    13571356        if ( 'user' === $avatar_data['object'] ) {
     1357            /** This action is documented in wp-includes/deprecated.php */
     1358            do_action_deprecated( 'xprofile_avatar_uploaded', array( (int) $avatar_data['item_id'], $avatar_data['type'], $r ), '6.0.0', 'bp_members_avatar_uploaded' );
     1359
    13581360            /** This action is documented in bp-core/bp-core-avatars.php */
    1359             do_action( 'xprofile_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r );
     1361            do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r );
    13601362        } elseif ( 'group' === $avatar_data['object'] ) {
    13611363            /** This action is documented in bp-groups/bp-groups-screens.php */
     
    19371939    $retval = false;
    19381940
    1939     // No need to carry on if the current WordPress version is not supported.
    1940     if ( ! bp_attachments_is_wp_version_supported() ) {
    1941         return $retval;
    1942     }
    1943 
    19441941    if ( bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step() ) {
    19451942        $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' );
Note: See TracChangeset for help on using the changeset viewer.