Accordion Blocks
Accordion Blocks is a simple plugin that adds a Gutenberg block for adding accordion drop-downs to your pages. The accordions should blend seamlessly with your theme. However, you may want to add custom styles to your theme. Features Adds a Gutenberg block for adding accordions to your site. Supports multiple accordions with individual settings for each accordion item. Fully responsive. Support for item IDs and direct links. Supports nesting accordions. Accessible (for users requiring tabbed keyboard navigation control). Optional Features Open individual accordion items by default. Disable auto closing of accordion items. Manually close items by clicking the title again. Scroll page to title when it’s clicked open (including setting a scroll offset position). Set the HTML heading tag for the title element (h1–h6, button). Set defaults to be applied to all new accordion items or reset a specific accordion item to the defaults. Supports adding custom block styles using wp.blocks.registerBlockStyle. Output The plugin will ultimately output following HTML (simplified for this example): Title with H2 tag Content Custom CSS You can use the following CSS classes to customize the look of the accordion. .c-accordion__item {} /* The accordion item container */ .c-accordion__item.is-open {} /* is-open is added to open accordion items */ .c-accordion__item.is-read {} /* is-read is added to accordion items that have been opened at least once */ .c-accordion__title {} /* An accordion item title */ .c-accordion__title--button {} /* An accordion item title that is using a ` ` tag */ .c-accordion__title:hover {} /* To modify the style when hovering over an accordion item title */ .c-accordion__title:focus {} /* To modify the style when an accordion item title currently has broswer focus */ .c-accordion__content {} /* An accordion item content container */
Headless
Adds features to use WordPress as a headless CMS: extra fields and prepared block content on the REST API, custom routes for menus and site settings, a preview that points at your frontend instead of the WordPress theme, and cache revalidation for frontends that support it. Configuration The plugin is configured with constants in wp-config.php: HEADLESS_HEAD_BASE_URL — base URL of your frontend. Preview and revalidation requests go here. HEADLESS_SECRET_TOKEN — shared token sent to the frontend’s /api/preview and /api/revalidate endpoints. HEADLESS_API_KEY_HEADER_KEY and HEADLESS_API_KEY_HEADER_VALUE — require this HTTP header on requests that use the plugin’s REST additions. Who can read the responses The plugin’s REST additions activate on requests carrying ?headless=true. That query parameter is a routing flag, not authentication — anyone can set it. Unless you configure HEADLESS_API_KEY_HEADER_KEY and HEADLESS_API_KEY_HEADER_VALUE, the /headless/v1/menus and /headless/v1/settings routes and the added post fields are readable by anyone who can reach your REST API. Configure the API key if that is not what you want. HEADLESS_SECRET_TOKEN is a single shared secret, and the admin pages hand it to the browser so the editor can open a preview. Every user who can edit posts — Contributor upwards — can therefore read it and use it against your frontend’s preview and revalidation endpoints directly. Treat it as a secret shared with your whole editorial team, and give the frontend its own rate limiting. Arbitrary section BREAKING CHANGE 1.7.0: core/block for block references has changed