diff --git src/bp-core/bp-core-attachments.php src/bp-core/bp-core-attachments.php
index d454d88..a7b2399 100644
|
|
|
6 | 6 | * @subpackage Attachments |
7 | 7 | */ |
8 | 8 | |
| 9 | |
9 | 10 | // Exit if accessed directly |
10 | 11 | defined( 'ABSPATH' ) || exit; |
11 | 12 | |
12 | 13 | /** |
| 14 | * Check if the current WordPress version is using Plupload 2.1.1 |
| 15 | * |
| 16 | * Plupload 2.1.1 was introduced in WordPress 3.9. Our bp-plupload.js |
| 17 | * script requires it. So we need to make sure the current WordPress |
| 18 | * match with our needs. |
| 19 | * |
| 20 | * @since BuddyPress (2.3.0) |
| 21 | * |
| 22 | * @return bool True if WordPress is 3.9+, false otherwise |
| 23 | */ |
| 24 | function bp_attachments_is_wp_version_supported() { |
| 25 | return (bool) version_compare( bp_get_major_wp_version(), '3.9', '>=' ); |
| 26 | } |
| 27 | |
| 28 | /** |
13 | 29 | * Get the BuddyPress Plupload settings |
14 | 30 | * |
15 | 31 | * @since BuddyPress (2.3.0) |
diff --git src/bp-core/bp-core-avatars.php src/bp-core/bp-core-avatars.php
index 8457c03..7ef2019 100644
|
|
add_action( 'bp_parse_query', 'bp_core_avatar_reset_query', 10, 1 ); |
1793 | 1793 | function bp_avatar_is_front_edit() { |
1794 | 1794 | $retval = false; |
1795 | 1795 | |
| 1796 | // No need to carry on if the current WordPress version is not supported. |
| 1797 | if ( ! bp_attachments_is_wp_version_supported() ) { |
| 1798 | return $retval; |
| 1799 | } |
| 1800 | |
1796 | 1801 | if ( bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step() ) { |
1797 | 1802 | $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ); |
1798 | 1803 | } |
diff --git src/bp-xprofile/bp-xprofile-admin.php src/bp-xprofile/bp-xprofile-admin.php
index 27376e6..1fb255a 100644
|
|
class BP_XProfile_User_Admin { |
690 | 690 | * @since BuddyPress (2.3.0) |
691 | 691 | */ |
692 | 692 | public function enqueue_scripts( $screen_id ) { |
693 | | if ( ( false === strpos( $screen_id, 'users_page_bp-profile-edit' ) && false === strpos( $screen_id, 'profile_page_bp-profile-edit' ) ) || bp_core_get_root_option( 'bp-disable-avatar-uploads' ) || ! buddypress()->avatar->show_avatars ) { |
| 693 | if ( ( false === strpos( $screen_id, 'users_page_bp-profile-edit' ) |
| 694 | && false === strpos( $screen_id, 'profile_page_bp-profile-edit' ) ) |
| 695 | || bp_core_get_root_option( 'bp-disable-avatar-uploads' ) |
| 696 | || ! buddypress()->avatar->show_avatars |
| 697 | || ! bp_attachments_is_wp_version_supported() ) { |
694 | 698 | return; |
695 | 699 | } |
696 | 700 | |
… |
… |
class BP_XProfile_User_Admin { |
1069 | 1073 | |
1070 | 1074 | <?php endif; |
1071 | 1075 | |
1072 | | // Load the Avatar UI templates if user avatar uploads are enabled |
1073 | | if ( ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ) ) : ?> |
| 1076 | // Load the Avatar UI templates if user avatar uploads are enabled and current WordPress version is supported |
| 1077 | if ( ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ) && bp_attachments_is_wp_version_supported() ) : ?> |
1074 | 1078 | <a href="#TB_inline?width=800px&height=400px&inlineId=bp-xprofile-avatar-editor" title="<?php esc_attr_e( 'Edit Profile Photo', 'buddypress' );?>" class="thickbox bp-xprofile-avatar-user-edit"><?php esc_html_e( 'Edit Profile Photo', 'buddypress' ); ?></a> |
1075 | 1079 | <div id="bp-xprofile-avatar-editor" style="display:none;"> |
1076 | 1080 | <?php bp_attachments_get_template_part( 'avatars/index' ); ?> |