diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index b0b1a3cd3..ba8d6994f 100644
|
|
function bp_get_deprecated_functions_versions() { |
4975 | 4975 | return $deprecated_functions_versions; |
4976 | 4976 | } |
4977 | 4977 | |
| 4978 | // Allow development version of BuddyPress to load deprecated functions the same as production version. |
| 4979 | $bypass = (bool) apply_filters( 'bypass_bp_source_subdirectory_check', false ); |
| 4980 | |
4978 | 4981 | /* |
4979 | 4982 | * Unless the `BP_IGNORE_DEPRECATED` constant is used & set to false, the development |
4980 | | * version of BuddyPress do not load deprecated functions. |
| 4983 | * version of BuddyPress do not load deprecated functions, except when 'bypass_bp_source_subdirectory_check' |
| 4984 | * is true. |
4981 | 4985 | */ |
4982 | | if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY === 'src' ) { |
| 4986 | if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY === 'src' && ! $bypass ) { |
4983 | 4987 | return array(); |
4984 | 4988 | } |
4985 | 4989 | |
… |
… |
function bp_get_deprecated_functions_versions() { |
5011 | 5015 | } |
5012 | 5016 | } |
5013 | 5017 | |
5014 | | // Load 12.0 deprecated functions only when BP was installed with 12.0 or 14.0. |
5015 | | if ( in_array( $initial_version, array( 12.0, 14.0 ) ) ) { |
| 5018 | // Load 12.0 deprecated functions only when BP was installed with 12.0, 14.0 or 15.0. |
| 5019 | if ( in_array( $initial_version, array( 12.0, 14.0, 15.0 ) ) ) { |
5016 | 5020 | return array( 12.0 ); |
5017 | 5021 | } |
5018 | 5022 | |
5019 | 5023 | return array(); |
5020 | 5024 | } |
5021 | 5025 | |
5022 | | $index_first_major = array_search( $initial_version, $deprecated_functions_versions, true ); |
5023 | | if ( false === $index_first_major ) { |
5024 | | return array_splice( $deprecated_functions_versions, -2 ); |
5025 | | } |
5026 | | |
5027 | | $latest_deprecated_functions_versions = array_splice( $deprecated_functions_versions, $index_first_major ); |
5028 | | |
5029 | | if ( 2 <= count( $latest_deprecated_functions_versions ) ) { |
5030 | | $latest_deprecated_functions_versions = array_splice( $latest_deprecated_functions_versions, -2 ); |
5031 | | } |
5032 | | |
5033 | | $index_initial_version = array_search( $initial_version, $latest_deprecated_functions_versions, true ); |
5034 | | if ( false !== $index_initial_version ) { |
5035 | | unset( $latest_deprecated_functions_versions[ $index_initial_version ] ); |
5036 | | } |
5037 | | |
5038 | | if ( $initial_version < 15.0 ) { |
5039 | | $latest_deprecated_functions_versions = array_merge( array( 12.0 ), $latest_deprecated_functions_versions ); |
| 5026 | if ( (float) 15 >= $current_major_version ) { |
| 5027 | $keep_last = count( $deprecated_functions_versions ) - array_search( 12.0, $deprecated_functions_versions, true ); |
| 5028 | } else { |
| 5029 | $keep_last = 2; |
5040 | 5030 | } |
5041 | 5031 | |
5042 | | return $latest_deprecated_functions_versions; |
| 5032 | // Only load deprecated functions determined by $keep_last. |
| 5033 | return array_splice( $deprecated_functions_versions, -$keep_last ); |
5043 | 5034 | } |
5044 | 5035 | |
5045 | 5036 | /** |