Title: Disable Block &#8211; Hide blocks in the frontend
Author: landwire
Published: <strong>2022 年 9 月 29 日</strong>
Last modified: 2025 年 7 月 13 日

---

搜尋外掛

![](https://ps.w.org/disable-block/assets/banner-772x250.png?rev=2792154)

![](https://ps.w.org/disable-block/assets/icon.svg?rev=2792157)

# Disable Block – Hide blocks in the frontend

 由 [landwire](https://profiles.wordpress.org/landwire/) 開發

[下載](https://downloads.wordpress.org/plugin/disable-block.1.3.2.zip)

[即時預覽](https://tw.wordpress.org/plugins/disable-block/?preview=1)

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

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

## 外掛說明

Disable Block adds a simple button to the editor to disable the block on the frontend,
hiding it from viewers.
 Perfect for blocks that are not ready to be viewed by the
public, but you are working on in the backend.

It adds subtle markings in the editor, so that you can easily see which blocks are
disabled.
 Now it also adds some markings in the list view of the editor.

#### Features

 * Show or hide blocks with one click
 * Adds subtle markings and block name, so you can see which block is disabled, 
   leaving most of the design in the editor intact.

#### Limitations

Does not work with the Classic Block, Widget Block or Widget Area Block [‘core/freeform’,‘
core/legacy-widget’, ‘core/widget-area’], as the those blocks do not support block
attributes. Does also not work with the HTML Block [‘core/html’] inside the Widget
Screen, as this one also does not support block attributes there.

#### Configuration

Just activate the plugin. The “Disable Block” button will then appear in the toolbar
of each block.

## 螢幕擷圖

 * [[
 * The ‘Disable Block’ button at work in the block editor.

## 常見問題集

### Can I change the styling in the admin that marks which blocks are hidden?

Yes, of course this is possible with a filter.
 Ideally do not change the “content:
attr(data-spk-block-disabled);” as it creates the text for the labelling.

    ```
    function change_css_styles_example_function($css)
            {
                $css = '[data-spk-block-disabled]:before {
                          color: #fff;
                          content: attr(data-spk-block-disabled);
                          z-index: 2;
                          background: #8b0000;
                          padding: 2px 6px;
                          font-size: 12px;
                          font-weight: 700;
                          position: absolute;
                          top: 0;
                          transform: translateY(calc(-100% + 1px));
                          right: 0;
                        }
                        [data-spk-block-disabled]:after {
                          content: '';
                          z-index: 1;
                          border-top: 5px solid #8b0000;
                          border-right: 5px solid #8b0000;
                          border-radius: 0;
                          position: absolute;
                          inset: 0;
                        }';

                return $css;
            }

     add_filter('disable_block_admin_styles', 'change_css_styles_example_function', 10);
    ```

## 使用者評論

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

### 󠀁[Works very well and stable](https://wordpress.org/support/topic/works-very-well-and-stable/)󠁿

 [Mitzi_Rebel](https://profiles.wordpress.org/mitzi_rebel/) 2023 年 3 月 15 日 1
則留言

Easy light-weight plugin. Works very well and stable so far.

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

## 參與者及開發者

以下人員參與了開源軟體〈Disable Block – Hide blocks in the frontend〉的開發相關工作。

參與者

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

[將〈Disable Block – Hide blocks in the frontend〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/disable-block)

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

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

## 變更記錄

#### 1.3.2

 * Fixed CSS styling and updated readme

#### 1.3.1

 * Fixed asset bundling

#### 1.3.0

 * Added listview support

#### 1.2.1

 * Updated asset loading for changes introduced in WordPress 6.3
 * Fixed typo in CSS

#### 1.2.0

 * Fixed return type for render_block filter

#### 1.1.0

 * Added “disable_block_admin_styles” filter, so that developers can control the
   styling of the hidden block markings in the editor.

#### 1.0.0

 * Initial Release of the plugin

## 中繼資料

 *  版本 **1.3.2**
 *  最後更新 **11 個月前**
 *  啟用安裝數 **70+**
 *  WordPress 版本需求 ** 5.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.8.5**
 *  PHP 版本需求 ** 7.4 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/disable-block/)
 * 標籤:
 * [block](https://tw.wordpress.org/plugins/tags/block/)[disable](https://tw.wordpress.org/plugins/tags/disable/)
   [disable block](https://tw.wordpress.org/plugins/tags/disable-block/)[hide](https://tw.wordpress.org/plugins/tags/hide/)
   [hide block](https://tw.wordpress.org/plugins/tags/hide-block/)
 *  [進階檢視](https://tw.wordpress.org/plugins/disable-block/advanced/)

## 評分

 5 星，滿分為 5 星

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

[Your review](https://wordpress.org/support/plugin/disable-block/reviews/#new-post)

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

## 參與者

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

## 技術支援

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

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