Title: Accordion Blocks
Author: philbuchanan
Published: <strong>12 mars 2019</strong>
Last modified: 7 février 2022

---

Recherche d’extensions

Cette extension **n’a pas été testée avec plus de trois mises à jour majeures de
WordPress**. Elle peut ne plus être maintenue ou supportée et peut avoir des problèmes
de compatibilité lorsqu’elle est utilisée avec des versions de WordPress plus récentes.

![](https://ps.w.org/accordion-blocks/assets/icon-256x256.png?rev=2198298)

# Accordion Blocks

 Par [philbuchanan](https://profiles.wordpress.org/philbuchanan/)

[Télécharger](https://downloads.wordpress.org/plugin/accordion-blocks.1.5.0.zip)

 * [Détails](https://fr.wordpress.org/plugins/accordion-blocks/#description)
 * [Avis](https://fr.wordpress.org/plugins/accordion-blocks/#reviews)
 *  [Installation](https://fr.wordpress.org/plugins/accordion-blocks/#installation)
 * [Développement](https://fr.wordpress.org/plugins/accordion-blocks/#developers)

 [Support](https://wordpress.org/support/plugin/accordion-blocks/)

## Description

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):

    ```
    <div class="wp-block-pb-accordion-item c-accordion__item js-accordion-item" data-initially-open="false" data-click-to-close="true" data-auto-close="true" data-scroll="false" data-scroll-offset="0">
        <h2 id="at-76840" class="c-accordion__title js-accordion-controller" tabindex="0" role="button" aria-controls="ac-76840" aria-expanded="false">
            Title with H2 tag
        </h2>
        <div id="ac-76840" class="c-accordion__content" style="display:none" aria-hidden="true">
            <p>Content</p>
        </div>
    </div>
    ```

#### 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 `<button>` 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 */
    ```

## Captures d’écrans

[⌊Accordion block settings sidebar⌉⌊Accordion block settings sidebar⌉[

Accordion block settings sidebar

[⌊Accordion block in the editor⌉⌊Accordion block in the editor⌉[

Accordion block in the editor

## Blocs

Cette extension fournit 1 bloc.

 *   Accordion Item

## Installation

 1. Upload the ‘accordion-blocks’ folder to the ‘/wp-content/plugins/’ directory.
 2. Activate the plugin through the Plugins menu in WordPress.
 3. Add the accordions to your content.

## FAQ

### Can I change all my existing accordion items to the defaults?

No. It is not possible to change all your accordion item’s settings (within the 
same page or across multiple pages) to the defaults.

Although I would like to offer this feature, based on my research it would require
a significant amount of development time that I am unable to devote to a free plugin.
If you are a developer and would be interested in helping implement a feature like
that, please let me know.

### Why isn’t the JavaScript file loading on my site?

This is most likely caused by a poorly coded theme. This plugin makes use of the`
wp_footer()` function to load the JavaScript file and it’s dependancy (jQuery). 
Check your theme to ensure that the `wp_footer()` function is being called right
before the closing `</body>` tag in your theme’s footer.php file.

### Issues/Suggestions

For bug reports or feature requests or if you’d like to contribute to the plugin
you can check everything out on [Github](https://github.com/philbuchanan/Accordion-Blocks/).

## Avis

![](https://secure.gravatar.com/avatar/98f024910005dcb85220ee8d855f4ce643d5074b0915e778432aad83ee560672?
s=60&d=retro&r=g)

### 󠀁[Excellent solution for FAQs](https://wordpress.org/support/topic/excellent-solution-for-faqs/)󠁿

 [jasonbongreen](https://profiles.wordpress.org/jasonbongreen/) 31 mars 2024

I used this block with some custom CSS styling to create a responsive frequently
asked questions area of a site.

![](https://secure.gravatar.com/avatar/09abfeb1fbca4568adc61f19f4ae863c514cfec3c4515407bb68f81d9fcb91cb?
s=60&d=retro&r=g)

### 󠀁[easy to use](https://wordpress.org/support/topic/easy-to-use-4518/)󠁿

 [Sofi-Soao](https://profiles.wordpress.org/sofi-soao/) 3 novembre 2022

Nice block editor integration, super easy to use. I like the opportunity to pick
different headline types for each accordeon block what helps doing SEO.

![](https://secure.gravatar.com/avatar/bfeb8e5d7f84c0ffa90f4e99786324fccf61ee318351831e85064787eab97c46?
s=60&d=retro&r=g)

### 󠀁[Works well and easily customizable with CSS](https://wordpress.org/support/topic/works-well-and-easily-customizable-with-css/)󠁿

 [tompich](https://profiles.wordpress.org/tompich/) 22 octobre 2022

Does the job quite well. Simple and straight forward. However, it would be nice 
to smooth the movement (there’s some kind of small jump at the end of the opening
and the beginning of the closing)

![](https://secure.gravatar.com/avatar/6f433f7c89fdce37f9fe938b87063744aa4e857a2a384436028a7b5bb0d795d3?
s=60&d=retro&r=g)

### 󠀁[Issues with LiteSpeed Cache](https://wordpress.org/support/topic/issues-with-litespeed-cache-2/)󠁿

 [brs_paul](https://profiles.wordpress.org/brs_paul/) 12 octobre 2022

Great plugin, but it often won't work in Chrome or Edge, and often randomly will
work. a bit glitchy! We have the LiteSpeed Cache Plugin and is probably an issue
with the combine CCS or JS.

![](https://secure.gravatar.com/avatar/61090e2ef100818915e2ddf9d3d756a3be609bf4acd4264d92b14fdce7ae4e79?
s=60&d=retro&r=g)

### 󠀁[Phil, you lovely man!](https://wordpress.org/support/topic/phil-you-lovely-man/)󠁿

 [Jaakko Pöntinen](https://profiles.wordpress.org/jpontinen/) 8 février 2022

This should be WP Core. Lightweight, works, rocks. Thank you.

![](https://secure.gravatar.com/avatar/df6826f4afc312bfd03fddbcd070fbf30bf295241edfd373d48f8de31a7ffaa9?
s=60&d=retro&r=g)

### 󠀁[Fantastic lightweight](https://wordpress.org/support/topic/fantastic-lightweight/)󠁿

 [astwert](https://profiles.wordpress.org/astwert/) 31 janvier 2022

Fantastic lightweight. I'm very grateful for this important block. Thank you so 
much!

 [ Lire les 35 avis ](https://wordpress.org/support/plugin/accordion-blocks/reviews/)

## Contributeurs/contributrices & développeurs/développeuses

« Accordion Blocks » est un logiciel libre. Les personnes suivantes ont contribué
à cette extension.

Contributeurs

 *   [ philbuchanan ](https://profiles.wordpress.org/philbuchanan/)

“Accordion Blocks” a été traduit dans 5 locales. Remerciez [l’équipe de traduction](https://translate.wordpress.org/projects/wp-plugins/accordion-blocks/contributors)
pour ses contributions.

[Traduisez « Accordion Blocks » dans votre langue.](https://translate.wordpress.org/projects/wp-plugins/accordion-blocks)

### Le développement vous intéresse ?

[Parcourir le code](https://plugins.trac.wordpress.org/browser/accordion-blocks/),
consulter le [SVN dépôt](https://plugins.svn.wordpress.org/accordion-blocks/), ou
s’inscrire au [journal de développement](https://plugins.trac.wordpress.org/log/accordion-blocks/)
par [RSS](https://plugins.trac.wordpress.org/log/accordion-blocks/?limit=100&mode=stop_on_copy&format=rss).

## Journal des modifications

#### 1.5.0

 * Plugin now requires WordPress 5.9.
 * Use `useInnerBlocksProps` and `useInnerBlocksProps.save()` for inner blocks handling.

#### 1.4.1

 * Fixed: Fixed UUID not generating properly in widget editor.

#### 1.4.0

 * New: Use block API v2 with useBlockProps.
 * Fixed: Registering block with block.json file.
 * Fixed: Use BlockControls group setting for title tag toolbar.
 * Fixed: Replaced deprecated `registerStore` with `register`.
 * Fixed: Reference to which script contains translations is now correct.

#### 1.3.5

 * Fixed: An issue where the global loading of scripts and styles checkbox was checked
   when the setting was actually off.

#### 1.3.4

 * Fixed: Made turning off global loading of scripts and styles an explicit setting.
   You can turn off this off in Settings > Accordion Blocks.

#### 1.3.3

 * Fixed: Rolled back deprecated `registerStore` with `register` change since it
   only applies to WordPress 5.7+.

#### 1.3.2

 * New: Visual indicator of bottom of block when the block is selected.
 * New: Only load plugin assets when the page contains an accordion block.
 * Fixed: Replaced deprecated `registerStore` with `register`.

#### 1.3.1

 * Added support for WordPress 5.7.
 * New method for generating uuids that should be more reliable.

#### 1.3.0

 * New: Added h5 and h6 as options for title tag.
 * New: Only users with the role of Editor or Administrator can set new default 
   settings. All users can restore settings to defaults. This lays the groundwork
   for the ability to make this user definable in a settings page which may come
   in a future release.
 * Fixed: New accordions added by Authors wouldn’t function properly.

#### 1.2.2

 * Fixed: Unique IDs were not set for new accordion items for sites that didn’t 
   already have default options stored in the database.

#### 1.2.1

 * Fixed PHP error that slipped through.

#### 1.2.0

 * Added support for WordPress 5.6, including fixing jQuery Migrate issues.
 * Added support for grouping accordion items.
 * Added support for nested accordion items.
 * Removed accordion settings API for getting and setting defaults in favour of 
   use useEntityProp.

#### 1.1.6

 * Fixed: Use sample content (instead of real content) to preview custom blocks 
   styles in the editor.
 * Fixed: Bumped required version to WordPress 5.4.

#### 1.1.5

 * Fixed: Resolved issue with PHP notice for not setting permission_callback in 
   REST API.

#### 1.1.4

 * Added: Support for WordPress 5.5
 * Fixed: no-js styles are now specific to the accordion item block

#### 1.1.3

 * Fixed: When typing backspace on a button title, it would delete the entire accordion
   item instead of backspacing a character

#### 1.1.2

 * Fixed: Accordion titles once again support bold and italic formats
 * Fixed: Translation should now be possible via WordPress translation site

#### 1.1.1

 * Fixed: An issue where, on some sites, accordion content would not smoothly animate
   open, instead just appearing instantly after a short delay
 * Fixed: Duplicated accordion items now have unique IDs which should resolve the
   issue where clicking on the duplicate title opens the original block

#### 1.1.0

 * New: An option to set default accordion item settings that will be applied to
   all newly created accordions. Individual accordion items can be reset to whatever
   is set as the defaults.
 * Fixed: Accordions not working if showing multiple posts’ content on one page.
   Unfortunately this will only apply to newly created accordions. Old accordions
   will need to be replaced to work properly.
 * Fixed: Users without the `unfiltered_html` permission (i.e. users with Author
   or lower user role) would get an « invalid content » error when viewing an accordion
   added by a user with the `unfiltered_html` permission (and vise-versa).

#### 1.0.6

 * Fixed typo in plugin settings

#### 1.0.5

 * Added minified versions of JS and CSS files

#### 1.0.4

 * Made plugin translatable
 * Code cleanup

#### 1.0.3

 * Added the ability to convert a paragraph or heading into an accordion.

#### 1.0.2

 * Added the ability for the block in the editor to accept custom css classes (allows
   for custom registration of Block Styles)
 * Accessibility fix: Removed aria-hidden=false from closed accordions.

#### 1.0.1

 * Updated readme.

#### 1.0.0

 * All new plugin to support the new WordPress Gutenberg editor.

## Méta

 *  Version **1.5.0**
 *  Dernière mise à jour **il y a 5 ans**
 *  Installations actives **10 000+**
 *  Version de WordPress ** 5.9 ou plus **
 *  Testé jusqu’à **5.9.19**
 *  Version de PHP ** 7.3 ou plus **
 *  Langues
 * [English (US)](https://wordpress.org/plugins/accordion-blocks/), [German](https://de.wordpress.org/plugins/accordion-blocks/),
   [Portuguese (Brazil)](https://br.wordpress.org/plugins/accordion-blocks/), [Russian](https://ru.wordpress.org/plugins/accordion-blocks/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/accordion-blocks/), et [Spanish (Spain)](https://es.wordpress.org/plugins/accordion-blocks/).
 *  [Traduisez la dans votre langue](https://translate.wordpress.org/projects/wp-plugins/accordion-blocks)
 * Étiquettes
 * [Accordion](https://fr.wordpress.org/plugins/tags/accordion/)[accordions](https://fr.wordpress.org/plugins/tags/accordions/)
   [block](https://fr.wordpress.org/plugins/tags/block/)[gutenberg](https://fr.wordpress.org/plugins/tags/gutenberg/)
   [responsive](https://fr.wordpress.org/plugins/tags/responsive/)
 *  [Vue avancée](https://fr.wordpress.org/plugins/accordion-blocks/advanced/)

## Évaluations

 5 sur 5 étoiles.

 *  [  36 avis à 5 étoiles     ](https://wordpress.org/support/plugin/accordion-blocks/reviews/?filter=5)
 *  [  0 avis à 4 étoile     ](https://wordpress.org/support/plugin/accordion-blocks/reviews/?filter=4)
 *  [  0 avis à 3 étoile     ](https://wordpress.org/support/plugin/accordion-blocks/reviews/?filter=3)
 *  [  0 avis à 2 étoile     ](https://wordpress.org/support/plugin/accordion-blocks/reviews/?filter=2)
 *  [  0 avis à 1 étoile     ](https://wordpress.org/support/plugin/accordion-blocks/reviews/?filter=1)

[Votre avis](https://wordpress.org/support/plugin/accordion-blocks/reviews/#new-post)

[Tout voir](https://wordpress.org/support/plugin/accordion-blocks/reviews/)

## Contributeurs

 *   [ philbuchanan ](https://profiles.wordpress.org/philbuchanan/)

## Support

Quelque chose à dire ? Besoin d’aide ?

 [Voir le forum de support](https://wordpress.org/support/plugin/accordion-blocks/)

## Faire un don

Souhaitez-vous soutenir l’avancement de cette extension ?

 [ Faire un don à cette extension ](https://philbuchanan.com/donate/)