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-messages/bp-messages-widgets.php

    r13096 r13153  
    1212
    1313/**
     14 * Registers the Sitewide Notices Legacy Widget.
     15 *
     16 * @since 10.0.0
     17 */
     18function bp_messages_register_sitewide_notices_widget() {
     19    register_widget( 'BP_Messages_Sitewide_Notices_Widget' );
     20}
     21
     22/**
    1423 * Register widgets for the Messages component.
    1524 *
     
    1726 */
    1827function bp_messages_register_widgets() {
    19     add_action(
    20         'widgets_init',
    21         function() {
    22             register_widget( 'BP_Messages_Sitewide_Notices_Widget' );
    23         }
    24     );
     28    add_action( 'widgets_init', 'bp_messages_register_sitewide_notices_widget' );
    2529}
    2630add_action( 'bp_register_widgets', 'bp_messages_register_widgets' );
Note: See TracChangeset for help on using the changeset viewer.