Title: Fast Blocks
Author: tdesero
Published: <strong>2021 年 5 月 26 日</strong>
Last modified: 2026 年 9 月 8 日

---

搜尋外掛

![](https://s.w.org/plugins/geopattern-icon/fast-blocks.svg)

# Fast Blocks

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

[下載](https://downloads.wordpress.org/plugin/fast-blocks.0.9.10.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/fast-blocks/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/fast-blocks/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/fast-blocks/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/fast-blocks/#developers)

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

## 外掛說明

Use the function `add_fast_block` to add a block to your theme in PHP. The Plugin
automatically creates an interface for your block inside the editor.
 Unlike the
default block behaviour all blocks are rendered dynamically. This means changes 
inside the template are shown immediately without resaving the post or page.

### Example Usage

Register your block:

    ```
    $options = [
      'name'      => 'some-slug/block-name',
      // template from theme-directory
      'template'  => '/blocks/test.php',
      'settings'  => [
        // same settings as the original "wp.registerBlockType" without attributes.
        'title'   => 'Plugin Block',
      ],
      'fields'    => [
        // define attributes and inputs/labels etc. that are needed.
        'headline'  => [
          'label'    => 'My Label',
          'type'     => 'string',
          'input'      => 'text',
          'default'  => 'default string',
          'width' => 0.5, // optional for all fields except repeater
          // optional selector: useful fallback if dynamic rendering does not work. Also good for WP SEO PLugins.
          'selector' => 'h2',
        ],
        'text'  => [
          'label'    => 'Some Text',
          'type'     => 'string',
          'input'      => 'richText',
          'default'  => 'default string',
        ],
        'image'   => [
          'label'   => 'Label for the Upload Button',
          'type'    => 'object',
          'input'   => 'image',
          'default' => [
            'url'   => 'image.jpeg',
            'alt'   => 'Alternative Text',
            'sizes' => []
          ]
        ],
        'bgColor' => [
          'label'   => 'Background',
          'type'    => 'string',
          'default' => 'light',
          'input'     => 'select',
          'options' => [
            ['label' => 'light', 'value' => 'light'],
            ['label' => 'dark', 'value' => 'dark'],
          ]
        ],
        'someBool' => [
          // ...
          'type'    => 'boolean',
          'input'   => 'checkbox',
        ],
        'someArray' => [
          // ...
          'type' => 'array',
          'default' => [],
          'input' => 'repeater',
          'query' => [
            'subField1' => [
              'type' => 'string',
              'input' => 'text',
              'default' => 'default list item',
            ],
            'subField2' => [
              'type' => 'boolean',
              'input' => 'checkbox',
              'default' => true,
            ],
          ]
        ]
      ]
    ];

    add_fast_block( $options );
    ```

Available inputs: `text`, `richText`, `checkbox`, `toggle`, `select`, `image`, `
url`, `email`, `date`.
 At the moment default values are mandatory.

Example usage inside template:

    ```
    <div>
      <h2><?php $block->field('headline'); ?></h2>
      <img src="<?php echo $block->field_value('image')['url']; ?>">
    </div>
    ```

For `$block->field` function sanitizing is done with `wp_kses_post`. If you need
more complex sanitizing, use `$block->field_value`, sanitize on your own and `echo`
the value afterwards.

## 安裝方式

 1. Upload the plugin files to the `/wp-content/plugins/fast-blocks` directory, or 
    install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress

## 常見問題集

### Do I have to know PHP to use this plugin?

Yes! this plugin is meant to be used by developers and people that create their 
own themes.

### Do I have to know JavaScript?

No! The JavaScript part is handled completely by the plugin.

### Does it work with SEO Plugins?

Yoast SEO is supported. To avoid problems with dynamic blocks and SEO analyzing 
Plugins, most fields are stored inside the block content the traditional way additionally.
But this doesn’t mean it is 100% reliable.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Fast Blocks〉的開發相關工作。

參與者

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

[將〈Fast Blocks〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/fast-blocks)

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

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

## 變更記錄

#### 0.9.8

 * Release
 * Flexible Content
 * apiVersion 3

#### 0.9.7

 * Release
 * tested up to WordPress 7.0

#### 0.9.6

 * Release
 * fix spacing between input fields

#### 0.9.5

 * Release
 * add color field input
 * yoast content analysis

#### 0.9.4

 * Release
 * fix issue with classic editor on mobile device preview
 * fix repeater field control issue

#### 0.9.0

 * Release
 * added “focalPointPicker” as option for image field
 * added ‘templateRenderCallback’ option when registering the block

#### 0.8.0

 * Release
    added “allowTransformFrom” option

## 中繼資料

 *  版本 **0.9.10**
 *  最後更新 **2 週前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 5.7 或更新版本 **
 *  已測試相容的 WordPress 版本 **7.1.2**
 *  PHP 版本需求 ** 7.0 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/fast-blocks/)
 * 標籤:
 * [block](https://tw.wordpress.org/plugins/tags/block/)
 *  [進階檢視](https://tw.wordpress.org/plugins/fast-blocks/advanced/)

## 評分

這個項目尚無任何評論記錄。

[撰寫評分](https://wordpress.org/support/plugin/fast-blocks/reviews/#new-post)

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

## 參與者

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

## 技術支援

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

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