[buddypress-trac] [BuddyPress Trac] #8515: Introduce a new function to check if a Widget or a Widget Block is active into a sidebar

buddypress-trac noreply at wordpress.org
Wed Jul 14 01:50:44 UTC 2021


#8515: Introduce a new function to check if a Widget or a Widget Block is active
into a sidebar
--------------------+---------------------
 Reporter:  imath   |       Owner:  imath
     Type:  task    |      Status:  closed
 Priority:  normal  |   Milestone:  9.0.0
Component:  Core    |     Version:
 Severity:  normal  |  Resolution:  fixed
 Keywords:          |
--------------------+---------------------
Changes (by imath):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"12997" 12997]:
 {{{
 #!CommitTicketReference repository="" revision="12997"
 Add a new function to check if a Widget/Block is active into a sidebar

 Some of our Legacy Widgets are being displayed only if active they have
 been included into a Sidebar Widget. We are using the `is_active_widget()`
 WordPress function to check whether it is the case or not. This function
 doesn't fit in the Widget Blocks case as all Blocks are being inserted
 into the specific `WP_Widget_Block` widget.

 As WordPress 5.8 doesn't provide any equivalent (so far?), we are
 introducing a new function to do this check:
 `bp_is_widget_block_active()`. It takes 2 optional arguments.
 - `$block_name`: the name of the block you need to check (eg:
 `'bp/members'`).
 - `$widget_id_base`: the Base ID of the widget (eg:
 `'bp_messages_sitewide_notices_widget'`).

 You can use it to check a block, a widget or both.

 Fixes #8515
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8515#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list