Skip to:
Content

BuddyPress.org

Changeset 13932


Ignore:
Timestamp:
06/20/2024 07:03:29 PM (6 months ago)
Author:
imath
Message:

Improve how BP extends the WP Theme Support for BP Standalone Themes

To be able to check whether a BP Standalone theme supports future specific BP Component features, we are filtering current_theme_supports-buddypress using the _bp_filter_current_theme_supports() callback function.

When a theme (eg: BP Default theme) was adding a buddypress support with no extra arguments, this callback was wrongly generating PHP errors when the extra arguments were empty.

This commit is making sure these errors are gone!

Props dd32

Fixes #8319
Closes https://github.com/buddypress/buddypress/pull/317

File:
1 edited

Legend:

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

    r13912 r13932  
    10901090 */
    10911091function _bp_filter_current_theme_supports( $supports = false, $args = array(), $feature = null ) {
    1092     $params             = reset( $args );
    1093     $is_expected_params = array_filter( array_map( 'is_string', array_keys( $params ) ) );
     1092    $is_expected_params = array();
     1093
     1094    if ( isset( $args[0] ) && is_array( $args[0] ) ) {
     1095        $is_expected_params = array_filter( array_map( 'is_string', array_keys( $args[0] ) ) );
     1096    }
    10941097
    10951098    if ( true === $supports && $is_expected_params ) {
Note: See TracChangeset for help on using the changeset viewer.