WP_CLI\Utils

wp_register_unused_sidebar()WP-CLI 1.0

Register the sidebar for unused widgets. Core does this in /wp-admin/widgets.php, which isn't helpful.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wp_register_unused_sidebar();

Код wp_register_unused_sidebar() WP-CLI 2.8.0-alpha

function wp_register_unused_sidebar() {

	register_sidebar(
		[
			'name'          => __( 'Inactive Widgets' ),
			'id'            => 'wp_inactive_widgets',
			'class'         => 'inactive-sidebar',
			'description'   => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ),
			'before_widget' => '',
			'after_widget'  => '',
			'before_title'  => '',
			'after_title'   => '',
		]
	);

}