Skip to:
Content

BuddyPress.org

Ticket #7906: 7906.2.diff

File 7906.2.diff, 3.3 KB (added by imath, 4 months ago)
  • src/bp-core/bp-core-functions.php

    diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
    index 21190f48d..b92385e41 100644
    function bp_db_version_raw() { 
    7070                return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
    7171        }
    7272
     73/**
     74 * Check whether the current version of WP exceeds a given version.
     75 *
     76 * @since 7.0.0
     77 *
     78 * @param string $version WP version, in "PHP-standardized" format.
     79 * @param string $compare Optional. Comparison operator. Default '>='.
     80 * @return bool
     81 */
     82function bp_is_running_wp( $version, $compare = '>=' ) {
     83        return version_compare( $GLOBALS['wp_version'], $version, $compare );
     84}
     85
    7386/** Functions *****************************************************************/
    7487
    7588/**
    function bp_email_get_appearance_settings() { 
    35383551                )
    35393552        );
    35403553
    3541         if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
     3554        if ( bp_is_running_wp( '4.9.6' ) ) {
    35423555                $privacy_policy_url = get_privacy_policy_url();
    35433556                if ( $privacy_policy_url ) {
    35443557                        $footer_text[] = sprintf(
  • src/bp-core/classes/class-bp-admin.php

    diff --git src/bp-core/classes/class-bp-admin.php src/bp-core/classes/class-bp-admin.php
    index a7823ab0e..d0c0fa800 100644
    class BP_Admin { 
    562562         */
    563563        public function add_privacy_policy_content() {
    564564                // Nothing to do if we're running < WP 4.9.6.
    565                 if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
     565                if ( bp_is_running_wp( '4.9.6', '<' ) ) {
    566566                        return;
    567567                }
    568568
  • src/bp-members/bp-members-template.php

    diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php
    index b6dac6b9e..e202ea11b 100644
    function bp_signup_avatar_dir_value() { 
    24162416 */
    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        }
    24222422
  • src/bp-settings/classes/class-bp-settings-component.php

    diff --git src/bp-settings/classes/class-bp-settings-component.php src/bp-settings/classes/class-bp-settings-component.php
    index dda4a928d..e48747f81 100644
    class BP_Settings_Component extends BP_Component { 
    193193                $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
    194194
    195195                // Export Data - only available for WP 4.9.6+.
    196                 if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
     196                if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) {
    197197                        $sub_nav[] = array(
    198198                                'name'            => __( 'Export Data', 'buddypress' ),
    199199                                'slug'            => 'data',
    class BP_Settings_Component extends BP_Component { 
    268268                        $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
    269269
    270270                        // Export Data.
    271                         if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
     271                        if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) {
    272272                                $wp_admin_nav[] = array(
    273273                                        'parent'   => 'my-account-' . $this->id,
    274274                                        'id'       => 'my-account-' . $this->id . '-data',