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

Block Pattern Builder

描述

Block Pattern Builder is a simple plugin that allows end-users to create custom block patterns within the WordPress plugin directory. The plugin currently requires Gutenberg 7.8+. Block patterns will be a part of core WordPress in the future. For now, Gutenberg is a hard requirement.

More information on block patterns can be found via the following links:

How to Use the Plugin

After installing and activating the plugin, you should see a new “Block Patterns” menu item in your WordPress admin. From that point, you can create a new pattern just like you would any post or page. The process is the same.

The idea with patterns is to create a reusable pattern or section of blocks that you will use later. Once you publish a pattern, it will be available within the pattern library.

Now, go to any post or page. Click on the pattern icon. At the time of writing, that icon is in the top right corner of the block editor, but this will surely change in future versions of Gutenberg and WordPress. After clicking on the icon, you should see your custom pattern in the pattern library/list. Click on it. It will be inserted into your post.

As of version 1.1.0, users can create a block pattern directly from the editor. Click on the “more options” button (ellipsis icon) in the editor toolbar with at least one block selected. Then, click the “Add to Block Patterns” option.

螢幕截圖

  • Block Patterns management screen.
  • Creating a custom block pattern.
  • Inserting a block pattern into the post editor.

常見問題

Why was this plugin created?

I thought it would be fun to build block patterns from the admin instead of writing code for them.

Block pattern is invalid. What should I do?

If this happens, something is off in the pattern. See if you can resolve the issue. Currently, block patterns are very early in development, so there is a distinct possibility of breakage.

Can I use this to build patterns for my theme?

Yes, certainly. You can build the patterns via the admin. Then, go to the code editor and copy the code version of the pattern. Then, register in your theme’s functions.php via the register_pattern() function. This way, you can ship your custom patterns directly to your theme users.

評價

2022年1月11日
This is a clean and simple, but very helpful plugin to create your own block patterns. If it had the option to manage block pattern categories as well, I'd consider even a 5 star rating… 😉
2020年12月23日
The Block Pattern Builder allows me to quickly use blocks over and over again, which is really essential to create content quickly and consistently. The only issue I have right now is that the patterns in the bottom of my list of 13 patterns are not listed when I search for them in the Gutenberg editor. If I have two patterns with "h2" in their name, it only shows the to one, for example. Not sure what is causing that? I hope a future version allows to change the saved pattern and apply the changes site wide (structure and design, not the content obviously). That would make maintenance so much more efficient. But I think it's a WordPress limitation at the moment, rather than a plugin limitation.
2020年11月26日
Thanks Justin for creating such a useful nifty plugin. I does not seem perfect in the way of finding and inserting the patterns in posts, but I am sure you will solve that.
2020年12月3日 2 replies
I REALLY like this plugin, but it is conflicting with Gutenberg Plugin v9.1.1 When inserting Block > choosing Browse All > then selecting Patterns ...... It gets an error The editor has encountered an unexpected error. Just respond that you got this .... then it goes back to 5 Stars! Thanks, looking forward to using. ------------------------------------- Due to "Bianca (@bianca205)", putting this to 5 Stars ... I hope she will forward this to the right people.
閱讀全部13個評價

貢獻者及開發者

“Block Pattern Builder” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

Block Pattern Builder 外掛目前已有 2 個本地化語言版本。 感謝所有譯者為這個外掛做出的貢獻。

將 Block Pattern Builder 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

The change log is located in the changelog.md file in the plugin folder. You may also view the change log online.