Changeset 12553
- Timestamp:
- 02/29/2020 03:28:51 PM (7 years ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 2 edited
-
admin/bp-core-admin-settings.php (modified) (2 diffs)
-
classes/class-bp-admin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-settings.php
r12056 r12553 148 148 } 149 149 150 /** Members *******************************************************************/ 151 152 /** 153 * Profile settings section description for the settings page. 154 * 155 * @since 1.6.0 156 */ 157 function bp_admin_setting_callback_members_section() { } 158 159 /** 160 * Allow members to upload avatars field. 161 * 162 * @since 1.6.0 163 * @since 6.0.0 Setting has been moved into the Members section. 164 */ 165 function bp_admin_setting_callback_avatar_uploads() { 166 ?> 167 <input id="bp-disable-avatar-uploads" name="bp-disable-avatar-uploads" type="checkbox" value="1" <?php checked( !bp_disable_avatar_uploads( false ) ); ?> /> 168 <label for="bp-disable-avatar-uploads"><?php _e( 'Allow registered members to upload avatars', 'buddypress' ); ?></label> 169 <?php 170 } 171 172 /** 173 * Allow members to upload cover images field. 174 * 175 * @since 2.4.0 176 * @since 6.0.0 Setting has been moved into the Members section. 177 */ 178 function bp_admin_setting_callback_cover_image_uploads() { 179 ?> 180 <input id="bp-disable-cover-image-uploads" name="bp-disable-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_cover_image_uploads() ); ?> /> 181 <label for="bp-disable-cover-image-uploads"><?php _e( 'Allow registered members to upload cover images', 'buddypress' ); ?></label> 182 <?php 183 } 184 150 185 /** XProfile ******************************************************************/ 151 186 … … 169 204 <label for="bp-disable-profile-sync"><?php _e( 'Enable BuddyPress to WordPress profile syncing', 'buddypress' ); ?></label> 170 205 171 <?php172 }173 174 /**175 * Allow members to upload avatars field.176 *177 * @since 1.6.0178 *179 */180 function bp_admin_setting_callback_avatar_uploads() {181 ?>182 183 <input id="bp-disable-avatar-uploads" name="bp-disable-avatar-uploads" type="checkbox" value="1" <?php checked( !bp_disable_avatar_uploads( false ) ); ?> />184 <label for="bp-disable-avatar-uploads"><?php _e( 'Allow registered members to upload avatars', 'buddypress' ); ?></label>185 186 <?php187 }188 189 /**190 * Allow members to upload cover images field.191 *192 * @since 2.4.0193 */194 function bp_admin_setting_callback_cover_image_uploads() {195 ?>196 <input id="bp-disable-cover-image-uploads" name="bp-disable-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_cover_image_uploads() ); ?> />197 <label for="bp-disable-cover-image-uploads"><?php _e( 'Allow registered members to upload cover images', 'buddypress' ); ?></label>198 206 <?php 199 207 } -
trunk/src/bp-core/classes/class-bp-admin.php
r12520 r12553 395 395 register_setting( 'buddypress', '_bp_theme_package_id', 'sanitize_text_field' ); 396 396 397 /* Members Section **************************************************/ 398 399 // Add the main section. 400 add_settings_section( 'bp_members', _x( 'Members Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_members_section', 'buddypress' ); 401 402 // Avatars. 403 add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_members' ); 404 register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' ); 405 406 // Cover images. 407 if ( bp_is_active( 'members', 'cover_image' ) ) { 408 add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_members' ); 409 register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' ); 410 } 411 397 412 /* XProfile Section **************************************************/ 398 413 … … 401 416 // Add the main section. 402 417 add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' ); 403 404 // Avatars.405 add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' );406 register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );407 408 // Cover images.409 if ( bp_is_active( 'xprofile', 'cover_image' ) ) {410 add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_xprofile' );411 register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );412 }413 418 414 419 // Profile sync setting.
Note:
See TracChangeset
for help on using the changeset viewer.