[buddypress-trac] [BuddyPress Trac] #9075: When first activating BuddyPress with 12.1.1, 12.0.0 deprecated functions are not loaded

buddypress-trac noreply at wordpress.org
Thu Jan 18 09:02:05 UTC 2024


#9075: When first activating BuddyPress with 12.1.1, 12.0.0 deprecated functions
are not loaded
---------------------------------------+---------------------
 Reporter:  imath                      |       Owner:  (none)
     Type:  defect (bug)               |      Status:  new
 Priority:  high                       |   Milestone:  12.2.0
Component:  Core                       |     Version:  12.0.0
 Severity:  normal                     |  Resolution:
 Keywords:  needs-patch needs-testing  |
---------------------------------------+---------------------

Comment (by vapvarun):

 can be improved with updating bp_get_deprecated_functions_versions()
 {{{
  $is_new_install = $initial_version === $current_version;

     // For new installs, return only the latest version's deprecated
 functions.
     if ( $is_new_install ) {
         return array( end($deprecated_functions_versions) );
     }
 }}}

 or like this
 If BP_LOAD_DEPRECATED is not set or set to false, the function returns
 only the latest version's deprecated functions, which aligns with the
 original logic for a first-time install.

 {{{

  $is_new_install = $initial_version === $current_version;

 // For new installs, if BP_LOAD_DEPRECATED is true, load all deprecated
 versions including 12.0.0.
     if ( $is_new_install ) {
         if ( defined( 'BP_LOAD_DEPRECATED' ) && BP_LOAD_DEPRECATED ) {
             return $deprecated_functions_versions; // Return all
 deprecated versions.
         }
         return array( end($deprecated_functions_versions) ); // Else,
 return only the latest version.
     }
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9075#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list