WordPress Version: 6.5
/**
* Checks if a sidebar is registered.
*
* @since 4.4.0
*
* @global array $wp_registered_sidebars The registered sidebars.
*
* @param string|int $sidebar_id The ID of the sidebar when it was registered.
* @return bool True if the sidebar is registered, false otherwise.
*/
function is_registered_sidebar($sidebar_id)
{
global $wp_registered_sidebars;
return isset($wp_registered_sidebars[$sidebar_id]);
}