Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/09/2020 07:17:20 PM (3 years ago)
Author:
imath
Message:

Core: introduce the bp_is_running_wp() function

This helper function checks WordPress version and is used by BuddyPress to ensure backward-compatibility when a WordPress feature/function is not yet available on the WordPress site BuddyPress is running on.

We have standardized the way we were doing these checks so far by replacing these with the use of this new bp_is_running_wp() function. It will help us to identify backward-compatibility chunks when we bump our minimum WP version.

bp_is_running_wp() accepts two arguments:

  • the WP version, in "PHP-standardized" format.
  • the comparison operator. It defaults to >=.

Props boonebgorges, r-a-y, espellcaste

Fixes #7906

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-cssjs.php

    r12531 r12745  
    5151
    5252    $preloaded_members = array();
    53     if ( function_exists( 'rest_preload_api_request' ) ) {
     53    if ( bp_is_running_wp( '5.0.0' ) ) {
    5454        $preloaded_members = rest_preload_api_request( '', $path );
    5555    }
Note: See TracChangeset for help on using the changeset viewer.