unregister_sidebar

The timeline below displays how wordpress function unregister_sidebar has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Removes a sidebar from the list.
 *
 * @since 2.2.0
 *
 * @global array $wp_registered_sidebars The registered sidebars.
 *
 * @param string|int $sidebar_id The ID of the sidebar when it was registered.
 */
function unregister_sidebar($sidebar_id)
{
    global $wp_registered_sidebars;
    unset($wp_registered_sidebars[$sidebar_id]);
}

WordPress Version: 5.5

/**
 * Removes a sidebar from the list.
 *
 * @since 2.2.0
 *
 * @global array $wp_registered_sidebars Registered sidebars.
 *
 * @param string|int $sidebar_id The ID of the sidebar when it was registered.
 */
function unregister_sidebar($sidebar_id)
{
    global $wp_registered_sidebars;
    unset($wp_registered_sidebars[$sidebar_id]);
}

WordPress Version: 5.1

/**
 * Removes a sidebar from the list.
 *
 * @since 2.2.0
 *
 * @global array $wp_registered_sidebars Removes the sidebar from this array by sidebar ID.
 *
 * @param string|int $sidebar_id The ID of the sidebar when it was registered.
 */
function unregister_sidebar($sidebar_id)
{
    global $wp_registered_sidebars;
    unset($wp_registered_sidebars[$sidebar_id]);
}

WordPress Version: 4.8

/**
 * Removes a sidebar from the list.
 *
 * @since 2.2.0
 *
 * @global array $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
 *
 * @param string|int $sidebar_id The ID of the sidebar when it was registered.
 */
function unregister_sidebar($sidebar_id)
{
    global $wp_registered_sidebars;
    unset($wp_registered_sidebars[$sidebar_id]);
}

WordPress Version: 4.3

/**
 * Removes a sidebar from the list.
 *
 * @since 2.2.0
 *
 * @global array $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
 *
 * @param string $name The ID of the sidebar when it was added.
 */
function unregister_sidebar($name)
{
    global $wp_registered_sidebars;
    unset($wp_registered_sidebars[$name]);
}

WordPress Version: 3.7

/**
 * Removes a sidebar from the list.
 *
 * @since 2.2.0
 *
 * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
 *
 * @param string $name The ID of the sidebar when it was added.
 */
function unregister_sidebar($name)
{
    global $wp_registered_sidebars;
    if (isset($wp_registered_sidebars[$name])) {
        unset($wp_registered_sidebars[$name]);
    }
}