Skip to:
Content

BuddyPress.org

Changeset 12561


Ignore:
Timestamp:
03/01/2020 02:15:04 PM (5 months ago)
Author:
imath
Message:

"Map" the xProfile cover image feature check to the Members one.

  • If a developer uses bp_is_active( 'xprofile', 'cover_image' ) return bp_is_active( 'member', 'cover_image' ) and inform it's no more the right way to check for the cover image feature.
  • deprecated the bp_is_profile_cover_image_active filter.

Fixes #8156

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r12546 r12561  
    20822082            if ( 'xprofile' === $component ) {
    20832083                $component = 'profile';
     2084
     2085                // The Cover Image feature has been moved to the Members component in 6.0.0.
     2086                if ( 'cover_image' === $feature && 'profile' === $component ) {
     2087                    _doing_it_wrong( 'bp_is_active( \'profile\', \'cover_image\' )', esc_html__( 'The cover image is a Members component feature, please use bp_is_active( \'members\', \'cover_image\' ) instead.', 'buddypress' ), '6.0.0' );
     2088                    $members_component = buddypress()->members;
     2089
     2090                    if ( ! isset( $members_component->features ) || false === in_array( $feature, $members_component->features, true ) ) {
     2091                        $retval = false;
     2092                    }
     2093
     2094                    /** This filter is documented in wp-includes/deprecated.php */
     2095                    return apply_filters_deprecated( 'bp_is_profile_cover_image_active', array( $retval ), '6.0.0', 'bp_is_members_cover_image_active' );
     2096                }
    20842097            }
    20852098
Note: See TracChangeset for help on using the changeset viewer.