Changeset 10152
- Timestamp:
- 09/29/2015 10:03:53 PM (9 years ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-settings.php
r10108 r10152 160 160 } 161 161 162 /** 163 * Allow members to upload cover images field. 164 * 165 * @since 2.4.0 166 */ 167 function bp_admin_setting_callback_cover_image_uploads() { 168 ?> 169 <input id="bp-disable-cover-image-uploads" name="bp-disable-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_cover_image_uploads() ); ?> /> 170 <label for="bp-disable-cover-image-uploads"><?php _e( 'Allow registered members to upload cover images', 'buddypress' ); ?></label> 171 <?php 172 } 173 162 174 /** Groups Section ************************************************************/ 163 175 … … 195 207 <input id="bp-disable-group-avatar-uploads" name="bp-disable-group-avatar-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_avatar_uploads() ); ?> /> 196 208 <label for="bp-disable-group-avatar-uploads"><?php _e( 'Allow customizable avatars for groups', 'buddypress' ); ?></label> 209 <?php 210 } 211 212 /** 213 * 'Enable group cover images' field markup. 214 * 215 * @since 2.4.0 216 */ 217 function bp_admin_setting_callback_group_cover_image_uploads() { 218 ?> 219 <input id="bp-disable-group-cover-image-uploads" name="bp-disable-group-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_cover_image_uploads() ); ?> /> 220 <label for="bp-disable-group-cover-image-uploads"><?php _e( 'Allow customizable cover images for groups', 'buddypress' ); ?></label> 197 221 <?php 198 222 } … … 300 324 'bp-disable-account-deletion', 301 325 'bp-disable-avatar-uploads', 326 'bp-disable-cover-image-uploads', 302 327 'bp-disable-group-avatar-uploads', 328 'bp-disable-group-cover-image-uploads', 303 329 'bp_disable_blogforum_comments', 304 330 'bp-disable-profile-sync', -
trunk/src/bp-core/bp-core-admin.php
r10108 r10152 339 339 add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' ); 340 340 341 // Avatars 341 342 add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' ); 342 343 register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' ); 344 345 // Cover images 346 if ( bp_is_active( 'xprofile', 'cover_image' ) ) { 347 add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_xprofile' ); 348 register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' ); 349 } 343 350 344 351 // Profile sync setting … … 361 368 add_settings_field( 'bp-disable-group-avatar-uploads', __( 'Group Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_avatar_uploads', 'buddypress', 'bp_groups' ); 362 369 register_setting( 'buddypress', 'bp-disable-group-avatar-uploads', 'intval' ); 370 371 // Allow group cover images. 372 if ( bp_is_active( 'groups', 'cover_image' ) ) { 373 add_settings_field( 'bp-disable-group-cover-image-uploads', __( 'Group Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_cover_image_uploads', 'buddypress', 'bp_groups' ); 374 register_setting( 'buddypress', 'bp-disable-group-cover-image-uploads', 'intval' ); 375 } 363 376 } 364 377 -
trunk/src/bp-core/bp-core-options.php
r10108 r10152 24 24 /** Components ********************************************************/ 25 25 26 'bp-deactivated-components' => array(),26 'bp-deactivated-components' => array(), 27 27 28 28 /** bbPress ***********************************************************/ 29 29 30 30 // Legacy bbPress config location 31 'bb-config-location' => ABSPATH . 'bb-config.php',31 'bb-config-location' => ABSPATH . 'bb-config.php', 32 32 33 33 /** XProfile **********************************************************/ 34 34 35 35 // Base profile groups name 36 'bp-xprofile-base-group-name' => 'Base',36 'bp-xprofile-base-group-name' => 'Base', 37 37 38 38 // Base fullname field name 39 'bp-xprofile-fullname-field-name' => 'Name',39 'bp-xprofile-fullname-field-name' => 'Name', 40 40 41 41 /** Blogs *************************************************************/ 42 42 43 43 // Used to decide if blogs need indexing 44 'bp-blogs-first-install' => false,44 'bp-blogs-first-install' => false, 45 45 46 46 /** Settings **********************************************************/ 47 47 48 48 // Disable the WP to BP profile sync 49 'bp-disable-profile-sync' => false,49 'bp-disable-profile-sync' => false, 50 50 51 51 // Hide the Toolbar for logged out users 52 'hide-loggedout-adminbar' => false,52 'hide-loggedout-adminbar' => false, 53 53 54 54 // Avatar uploads 55 'bp-disable-avatar-uploads' => false, 55 'bp-disable-avatar-uploads' => false, 56 57 // Cover image uploads 58 'bp-disable-cover-image-uploads' => false, 56 59 57 60 // Group Profile Photos 58 'bp-disable-group-avatar-uploads' => false, 61 'bp-disable-group-avatar-uploads' => false, 62 63 // Group Cover image uploads 64 'bp-disable-group-cover-image-uploads' => false, 59 65 60 66 // Allow users to delete their own accounts 61 'bp-disable-account-deletion' => false,67 'bp-disable-account-deletion' => false, 62 68 63 69 // Allow comments on blog and forum activity items 64 'bp-disable-blogforum-comments' => true,70 'bp-disable-blogforum-comments' => true, 65 71 66 72 // The ID for the current theme package. 67 '_bp_theme_package_id' => 'legacy',73 '_bp_theme_package_id' => 'legacy', 68 74 69 75 /** Groups ************************************************************/ … … 72 78 73 79 // Restrict group creation to super admins 74 'bp_restrict_group_creation' => false,80 'bp_restrict_group_creation' => false, 75 81 76 82 /** Akismet ***********************************************************/ 77 83 78 84 // Users from all sites can post 79 '_bp_enable_akismet' => true,85 '_bp_enable_akismet' => true, 80 86 81 87 /** Activity HeartBeat ************************************************/ 82 88 83 89 // HeartBeat is on to refresh activities 84 '_bp_enable_heartbeat_refresh' => true,90 '_bp_enable_heartbeat_refresh' => true, 85 91 86 92 /** BuddyBar **********************************************************/ 87 93 88 94 // Force the BuddyBar 89 '_bp_force_buddybar' => false,95 '_bp_force_buddybar' => false, 90 96 91 97 /** Legacy theme *********************************************/ 92 98 93 99 // Whether to register the bp-default themes directory 94 '_bp_retain_bp_default' => false,100 '_bp_retain_bp_default' => false, 95 101 96 102 /** Widgets **************************************************/ … … 597 603 598 604 /** 605 * Are members able to upload their own cover images? 606 * 607 * @since 2.4.0 608 * 609 * @uses bp_get_option() To get the cover image uploads option. 610 * 611 * @param bool $default Optional. Fallback value if not found in the database. 612 * Default: false. 613 * 614 * @return bool True if cover image uploads are disabled, otherwise false. 615 */ 616 function bp_disable_cover_image_uploads( $default = false ) { 617 618 /** 619 * Filters whether or not members are able to upload their own cover images. 620 * 621 * @since 2.4.0 622 * 623 * @param bool $value Whether or not members are able to upload their own cover images. 624 */ 625 return (bool) apply_filters( 'bp_disable_cover_image_uploads', (bool) bp_get_option( 'bp-disable-cover-image-uploads', $default ) ); 626 } 627 628 /** 599 629 * Are group avatars disabled? 600 630 * … … 629 659 */ 630 660 return (bool) apply_filters( 'bp_disable_group_avatar_uploads', $disabled, $default ); 661 } 662 663 /** 664 * Are group cover images disabled? 665 * 666 * @since 2.4.0 667 * 668 * @uses bp_get_option() To get the group cover image uploads option. 669 * 670 * @param bool $default Optional. Fallback value if not found in the database. 671 * Default: false. 672 * 673 * @return bool True if group cover image uploads are disabled, otherwise false. 674 */ 675 function bp_disable_group_cover_image_uploads( $default = false ) { 676 677 /** 678 * Filters whether or not members are able to upload group cover images. 679 * 680 * @since 2.4.0 681 * 682 * @param bool $value Whether or not members are able to upload thier groups cover images. 683 */ 684 return (bool) apply_filters( 'bp_disable_group_cover_image_uploads', (bool) bp_get_option( 'bp-disable-group-cover-image-uploads', $default ) ); 631 685 } 632 686 -
trunk/src/bp-core/bp-core-template.php
r10109 r10152 1935 1935 // Is feature active? 1936 1936 if ( ! empty( $feature ) ) { 1937 // The xProfile component is specific 1938 if ( 'xprofile' === $component ) { 1939 $component = 'profile'; 1940 } 1941 1937 1942 if ( empty( buddypress()->$component->features ) || false === in_array( $feature, buddypress()->$component->features, true ) ) { 1938 1943 $retval = false; … … 2245 2250 function bp_is_user_change_avatar() { 2246 2251 return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) ); 2252 } 2253 2254 /** 2255 * Is the current page the a user's change cover image profile page? 2256 * 2257 * Eg http://example.com/members/joe/profile/change-cover-image/ (or a subpage thereof). 2258 * 2259 * @since 2.4.0 2260 * 2261 * @return True if the current page is a user's profile edit cover image page. 2262 */ 2263 function bp_is_user_change_cover_image() { 2264 return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-cover-image' ) ); 2247 2265 } 2248 2266
Note: See TracChangeset
for help on using the changeset viewer.