Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/09/2020 07:17:20 PM (4 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-members/bp-members-template.php

    r12693 r12745  
    24172417function bp_signup_requires_privacy_policy_acceptance() {
    24182418    // Bail if we're running a version of WP that doesn't have the Privacy Policy feature.
    2419     if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
     2419    if ( bp_is_running_wp( '4.9.6', '<' ) ) {
    24202420        return false;
    24212421    }
Note: See TracChangeset for help on using the changeset viewer.