Skip to:
Content

BuddyPress.org

Changeset 5481


Ignore:
Timestamp:
12/10/2011 05:43:06 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Introduce bp_get_major_wp_version() function to work around version_compare() temporal paradox. See #3828 (1.5 branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-core/bp-core-wpabstraction.php

    r5159 r5481  
    1212// Exit if accessed directly
    1313if ( !defined( 'ABSPATH' ) ) exit;
     14
     15/**
     16 * Parso the WordPress core version number into the major release
     17 *
     18 * @since BuddyPress (1.5.2)
     19 * @global string $wp_version
     20 * @return string
     21 */
     22function bp_get_major_wp_version() {
     23    global $wp_version;
     24   
     25    return substr( $wp_version, 0, ( strpos( $wp_version, '.' ) + 2 ) );
     26}
    1427
    1528/**
Note: See TracChangeset for help on using the changeset viewer.