Skip to content

Commit 36aa3e1

Browse files
fix: exclude wp_inactive_widgets
1 parent 720ded9 commit 36aa3e1

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Sidebar_Command.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ public function list_( $args, $assoc_args ) {
7676
Utils\wp_register_unused_sidebar();
7777
}
7878

79-
$sidebars = $wp_registered_sidebars;
79+
// Filter out wp_inactive_widgets from the display
80+
$sidebars = array_filter(
81+
$wp_registered_sidebars,
82+
function( $sidebar ) {
83+
return 'wp_inactive_widgets' !== $sidebar['id'];
84+
}
85+
);
8086

8187
if ( isset( $assoc_args['format'] ) && 'ids' === $assoc_args['format'] ) {
8288
WP_CLI::line( implode( ' ', wp_list_pluck( $sidebars, 'id' ) ) );

0 commit comments

Comments
 (0)