diff --git a/projects/plugins/jetpack/changelog/update-internet-defense-league-widget-deprecate b/projects/plugins/jetpack/changelog/update-internet-defense-league-widget-deprecate new file mode 100644 index 0000000000000..68bbeafe9cd13 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-internet-defense-league-widget-deprecate @@ -0,0 +1,4 @@ +Significance: minor +Type: compat + +Internet Defense League widget: Widget deprecation diff --git a/projects/plugins/jetpack/modules/widgets/internet-defense-league.php b/projects/plugins/jetpack/modules/widgets/internet-defense-league.php index ba4170fa57575..3aa22ae80a8a8 100644 --- a/projects/plugins/jetpack/modules/widgets/internet-defense-league.php +++ b/projects/plugins/jetpack/modules/widgets/internet-defense-league.php @@ -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 ) {