Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/20/2014 09:43:10 PM (11 years ago)
Author:
imath
Message:

Makes group avatars not dependant of xprofile component settings

Avatar uploads setting is by default attached to xprofile settings. In case this component is disable and groups component is active, the avatar uploads setting will be attached to groups in order to keep on allowing avatar uploads for groups.

Fixes #5330

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-admin.php

    r7702 r7743  
    286286            add_settings_section( 'bp_xprofile',      __( 'Profile Settings', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress'                );
    287287
    288             // Allow avatar uploads
    289             add_settings_field( 'bp-disable-avatar-uploads', __( 'Avatar Uploads',   'buddypress' ), 'bp_admin_setting_callback_avatar_uploads',   'buddypress', 'bp_xprofile' );
    290             register_setting  ( 'buddypress',         'bp-disable-avatar-uploads',   'intval'                                                                                  );
     288            $avatar_setting = 'bp_xprofile';
    291289
    292290            // Profile sync setting
     
    301299            // Add the main section
    302300            add_settings_section( 'bp_groups',        __( 'Groups Settings',  'buddypress' ), 'bp_admin_setting_callback_groups_section',   'buddypress'              );
     301
     302            if ( empty( $avatar_setting ) )
     303                $avatar_setting = 'bp_groups';
    303304
    304305            // Allow subscriptions setting
     
    335336                register_setting  ( 'buddypress',         '_bp_enable_akismet',   'intval'                                                                                  );
    336337            }
     338        }
     339
     340        /** Avatar upload for users or groups ************************************/
     341       
     342        if ( ! empty( $avatar_setting ) ) {
     343            // Allow avatar uploads
     344            add_settings_field( 'bp-disable-avatar-uploads', __( 'Avatar Uploads',   'buddypress' ), 'bp_admin_setting_callback_avatar_uploads',   'buddypress', $avatar_setting );
     345            register_setting  ( 'buddypress',         'bp-disable-avatar-uploads',   'intval'                                                                                    );
    337346        }
    338347    }
Note: See TracChangeset for help on using the changeset viewer.