Title: Show / Hide Section Block
Author: Happy Prime
Published: <strong>2023 年 3 月 3 日</strong>
Last modified: 2025 年 5 月 8 日

---

搜尋外掛

![](https://ps.w.org/show-hide-section-block/assets/banner-772x250.jpg?rev=3290039)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/show-hide-section-block/assets/icon-256x256.jpg?rev=3290035)

# Show / Hide Section Block

 由 [Happy Prime](https://profiles.wordpress.org/happyprime/) 開發

[下載](https://downloads.wordpress.org/plugin/show-hide-section-block.3.1.0.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/show-hide-section-block/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/show-hide-section-block/#reviews)
 * [開發資訊](https://tw.wordpress.org/plugins/show-hide-section-block/#developers)

 [技術支援](https://wordpress.org/support/plugin/show-hide-section-block/)

## 外掛說明

Show / Hide Section Block provides four blocks that are used to display a group 
of `<details>` elements that each contain a `<summary>` and an arbitrary number 
of additional blocks.

 * The Show Hide Group block is a wrapping `<div>`.
 * The Show Hide Section block is a wrapping `<details>`. One or more of these blocks
   is added to a Show Hide Group block.
 * The Show Hide Summary block contains the content for a `<summary>` tag. One of
   these blocks is inside each Show Hide Section block.
 * The Show Hide Details block contains arbitrary content. One of these blocks is
   added inside each Show Hide Section block.

The HTML output for an individual section is:

    ```
    <!-- Each section block has a details element. -->
    <details class="wp-block-happyprime-show-hide-section">
        <!-- Each details element has a summary and additional, collapsible content. -->
        <summary class="wp-block-happyprime-show-hide-summary">Summary text</summary>
        <!-- Additional inner blocks of any type are populated here. -->
    </details>
    ```

The HTML output for the group is:

    ```
    <div class="wp-block-happyprime-show-hide-group">
        <!-- Optional based on attribute -->
        <button class="toggle-all" aria-expanded="false">Open all</button>
        <details class="wp-block-happyprime-show-hide-section">
            <summary class="wp-block-happyprime-show-hide-summary"></summary>
            <!-- Additional blocks to be shown/hidden -->
        </details>
        <details class="wp-block-happyprime-show-hide-section">
            <summary class="wp-block-happyprime-show-hide-summary"></summary>
            <!-- Additional blocks to be shown hidden -->
        </details>
        <!-- Additional section blocks -->
    </div>
    ```

An option is provided in the block’s side panel to toggle an “Open all”/”Close all”
button. If this is toggled on for a block, an additional `<button>` element will
be inserted and JavaScript will be used on the front-end to control the show/hide
behavior of all `<details>` elements in the group at once.

If the toggle is off, no JavaScript is loaded on the front end and only the browser’s
default behavior is used for opening and closing `<details>` elements.

## 適用於區塊編輯器

這個外掛提供 4 個可供區塊編輯器使用的區塊。

 *   Show Hide Group A group of accessible summaries that can be toggled to show
   or hide additional details.
 *   Show Hide Summary The summary element in a details section.
 *   Show Hide Details The remaining content in a details section.
 *   Show Hide Section A section of collapsible content contained in a details element
   with a summary.

## 使用者評論

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

### 󠀁[Simple, does what promises](https://wordpress.org/support/topic/simple-does-what-promises/)󠁿

 [segtendo](https://profiles.wordpress.org/segtendo/) 2025 年 6 月 26 日

Does what's on the box.

 [ 閱讀全部 1 則使用者評論 ](https://wordpress.org/support/plugin/show-hide-section-block/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Show / Hide Section Block〉的開發相關工作。

參與者

 *   [ Happy Prime ](https://profiles.wordpress.org/happyprime/)
 *   [ Jeremy Felt ](https://profiles.wordpress.org/jeremyfelt/)
 *   [ slocker ](https://profiles.wordpress.org/slocker/)
 *   [ philcable ](https://profiles.wordpress.org/philcable/)

[將〈Show / Hide Section Block〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/show-hide-section-block)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/show-hide-section-block/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/show-hide-section-block/)，或
透過 [RSS](https://plugins.trac.wordpress.org/log/show-hide-section-block/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/show-hide-section-block/)。

## 變更記錄

### 3.1.0

 * Automatically open an associated `<details>` element when its anchor is used 
   in a URL.
 * Update dependencies.
 * Confirm compatibility with WordPress 6.8.
 * Confirm license in plugin header.

### 3.0.0

 * Refactor block markup to improve editorial experience and formatting options.
 * Introduce `happyprime/show-hide-summary` block to manage `<summary>` content.
 * Introduce `happyprime/show-hide-details` block to manage remaningin `<details
   >` content.
 * Upgrade `happyprime/show-hide-group` and `happyprime/show-hide-section` blocks
   to API v3.
 * Add a deprecation routine to transform 2.0.x block markup into the new format.
 * Replace `@wordpress/scripts` with slimmer build configuration.
 * Bump minimum WordPress version to 6.4; confirm compatibility with 6.7.

### 2.0.3

 * Fix an issue where the front-end script was enqueued twice.

### 2.0.2

 * Fix an issue preventing Open All toggle from working in Chrome.
 * Update `@wordpress/scripts` dependency to 26.3.0.
 * Improve block organization, use of `block.json`.

### 2.0.1

 * Add a variety of `supports` options to `block.json` so that core styles can be
   applied as expected.
 * Improve asset loading so that the front-end script is only enqueued when the 
   block is in use **and** when the the open/close all option is selected.
 * Add languages directory, POT file for translations.

### 2.0.0

Initial public release.

## 中繼資料

 *  版本 **3.1.0**
 *  最後更新 **1 年前**
 *  啟用安裝數 **90+**
 *  WordPress 版本需求 ** 6.4 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.8.10**
 *  PHP 版本需求 ** 7.4 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/show-hide-section-block/)
 * 標籤:
 * [collapsible](https://tw.wordpress.org/plugins/tags/collapsible/)[details](https://tw.wordpress.org/plugins/tags/details/)
   [summary](https://tw.wordpress.org/plugins/tags/summary/)
 *  [進階檢視](https://tw.wordpress.org/plugins/show-hide-section-block/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  1 個 5 星使用者評論     ](https://wordpress.org/support/plugin/show-hide-section-block/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/show-hide-section-block/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/show-hide-section-block/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/show-hide-section-block/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/show-hide-section-block/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/show-hide-section-block/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/show-hide-section-block/reviews/)

## 參與者

 *   [ Happy Prime ](https://profiles.wordpress.org/happyprime/)
 *   [ Jeremy Felt ](https://profiles.wordpress.org/jeremyfelt/)
 *   [ slocker ](https://profiles.wordpress.org/slocker/)
 *   [ philcable ](https://profiles.wordpress.org/philcable/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/show-hide-section-block/)