public function getSidebar($sidebar_name)
    {
        global $wp_registered_sidebars;

        $sidebar_id = null;

        foreach ($wp_registered_sidebars as $registered_sidebar_id => $registered_sidebar) {
            if ($sidebar_name === $registered_sidebar['name']) {
                $sidebar_id = $registered_sidebar_id;
                break;
            }
        }

        if ($sidebar_id === null) {
            throw new UnexpectedValueException(sprintf('[W614] Sidebar "%s" does not exist', $sidebar_name));
        }

        return $sidebar_id;
    }
public function getSidebar($sidebar_name)
    {
        global $wp_registered_sidebars;

        $sidebar_id = null;

        foreach ($wp_registered_sidebars as $registered_sidebar_id => $registered_sidebar) {
            if ($sidebar_name === $registered_sidebar['name']) {
                $sidebar_id = $registered_sidebar_id;
                break;
            }
        }

        if ($sidebar_id === null) {
            throw new UnexpectedValueException(sprintf('[W614] Sidebar "%s" does not exist', $sidebar_name));
        }

        return $sidebar_id;
    }
public function getSidebar ( $ sidebar_name ) { global $ wp_registered_sidebars ; $ sidebar_id = null ; foreach ( $ wp_registered_sidebars as $ registered_sidebar_id => $ registered_sidebar ) { if ( $ sidebar_name === $ registered_sidebar [ 'name' ] ) { $ sidebar_id = $ registered_sidebar_id ; break ; } } if ( $ sidebar_id === null ) { throw new UnexpectedValueException ( sprintf ( '[W614] Sidebar "%s" does not exist' , $ sidebar_name ) ) ; } return $ sidebar_id ; }
Gets a sidebar ID from its human-readable name.

@param string $sidebar_name The name of the sidebar (e.g. 'Footer', 'Widget Area', 'Right Sidebar').

@return string The sidebar ID.

@throws UnexpectedValueException If the sidebar is not registered.
Gets a sidebar ID from its human - readable name .