Skip to:
Content

BuddyPress.org

Ticket #8156: 8156.4.patch

File 8156.4.patch, 1.3 KB (added by imath, 5 months ago)

bp_is_active( 'xprofile', 'cover_image' ) deprecation notice.

  • src/bp-core/bp-core-template.php

    diff --git src/bp-core/bp-core-template.php src/bp-core/bp-core-template.php
    index 7f1dd1de2..4ddbf74e3 100644
    function bp_is_active( $component = '', $feature = '' ) { 
    20812081                        // The xProfile component is specific.
    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
    20862099                        $component_features = isset( buddypress()->{$component}->features ) ? buddypress()->{$component}->features : array();