Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/09/2020 07:17:20 PM (6 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-core/bp-core-theme-compatibility.php

    r12558 r12745  
    666666function bp_template_include_theme_compat( $template = '' ) {
    667667    // If embed template, bail.
    668     if ( true === function_exists( 'is_embed' ) && is_embed() ) {
     668    if ( is_embed() ) {
    669669        return $template;
    670670    }
Note: See TracChangeset for help on using the changeset viewer.