Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/13/2021 05:26:01 PM (5 years ago)
Author:
imath
Message:

Anticipate the potential arrival of the Widgets Block Editor in WP 5.8

  • Make sure the get_current_screen() is available before using it when loading BP Mentions JS & CSS.
  • Make sure the BP Nouveau Activity Widget's activity type setting is fully unserialized.

Fixes #8476

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/activity/widgets.php

    r12156 r12949  
    44 *
    55 * @since 3.0.0
    6  * @version 3.1.0
     6 * @version 8.0.0
    77 */
    88
     
    8181        $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    8282
    83         // Check instance for custom max number of activities to display
     83        // Check instance for custom max number of activities to display.
    8484        if ( ! empty( $instance['max'] ) ) {
    8585            $max = (int) $instance['max'];
    8686        }
    8787
    88         // Check instance for custom activity types
     88        // Check instance for custom activity types.
    8989        if ( ! empty( $instance['type'] ) ) {
    90             $type    = maybe_unserialize( $instance['type'] );
     90            $type = maybe_unserialize( $instance['type'] );
     91            if ( ! is_array( $type ) ) {
     92                $type = (array) maybe_unserialize( $type );
     93            }
     94
    9195            $classes = array_map( 'sanitize_html_class', array_merge( $type, array( 'bp-latest-activities' ) ) );
    9296
     
    182186        if ( ! empty( $instance['type'] ) ) {
    183187            $type = maybe_unserialize( $instance['type'] );
     188            if ( ! is_array( $type ) ) {
     189                $type = (array) maybe_unserialize( $type );
     190            }
    184191        }
    185192        ?>
Note: See TracChangeset for help on using the changeset viewer.