Skip to content

Commit

Permalink
Internet Defense League widget: Widget deprecation (#22676)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-ottinger authored Feb 4, 2022
1 parent d2bc493 commit b5a7ebb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: compat

Internet Defense League widget: Widget deprecation
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ function __construct() {
'variant' => key( $this->variants ),
'badge' => key( $this->badges ),
);

add_filter( 'widget_types_to_hide_from_legacy_widget_block', array( $this, 'hide_widget_in_block_editor' ) );
}

/**
* Remove the "Internet Defense League" widget from the Legacy Widget block
*
* @param array $widget_types List of widgets that are currently removed from the Legacy Widget block.
* @return array $widget_types New list of widgets that will be removed.
*/
public function hide_widget_in_block_editor( $widget_types ) {
$widget_types[] = 'internet_defense_league_widget';
return $widget_types;
}

public function widget( $args, $instance ) {
Expand Down

0 comments on commit b5a7ebb

Please sign in to comment.