Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/19/2021 05:03:56 AM (3 years ago)
Author:
imath
Message:

Only load BP Legacy Widgets when the Widgets Block editor is disabled

To improve the Widgets Block editor's users experience, we are making a new step towards deprecating BP Legacy Widgets by not loading them by default. As a result, into this editor, only BP Widget Blocks will be loaded and listed into the Block inserter of the Widgets screen.

If users want to keep the Legacy Widgets into the Widgets Block editor, they can do so returning true to this filter 'bp_core_retain_legacy_widgets'.

If users are using the Classic Widgets Editor plugin or if advanced users are directly filtering 'use_widgets_block_editor' to return false: Legacy Widgets will still be available into the Classic Widgets Editor.

Fixes #8594

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-widgets.php

    r11366 r13153  
    1212
    1313/**
     14 * Registers the Recent Posts Legacy Widget.
     15 *
     16 * @since 10.0.0
     17 */
     18function bp_blogs_register_recent_posts_widget() {
     19    register_widget( 'BP_Blogs_Recent_Posts_Widget' );
     20}
     21
     22/**
    1423 * Register the widgets for the Blogs component.
    1524 */
     
    1827
    1928    if ( bp_is_active( 'activity' ) && bp_is_root_blog( $wpdb->blogid ) ) {
    20         add_action( 'widgets_init', function() { register_widget( 'BP_Blogs_Recent_Posts_Widget' ); } );
     29        add_action( 'widgets_init', 'bp_blogs_register_recent_posts_widget' );
    2130    }
    2231}
Note: See TracChangeset for help on using the changeset viewer.