[WordPress] 外掛分享: Blocks Everywhere

WordPress 外掛 Blocks Everywhere 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Blocks Everywhere」是 2022-11-07 上架。
  • 目前有 40 個安裝啟用數。
  • 上一次更新是 2023-10-18,距離現在已有 564 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 6.2 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
  • 有 1 人給過評分。
  • 論壇上目前有 2 個提問,問題解答率 0%

外掛協作開發者

johnny5 | automattic |

外掛標籤

bbPress | comments | gutenberg | buddypress |

內容簡介

此外掛程式將 WordPress 的預設評論、bbPress 和 BuddyPress 編輯器切換成使用 Gutenberg 編輯器。這些編輯器現在可以使用更豐富的編輯工具,並且可以使用完整的 Gutenberg 區塊功能。
管理員審核也使用 Gutenberg 升級,前端處理區塊。
為了增加安全性,可用區塊清單是由 WordPress 允許的標籤決定的。
Gutenberg 並非捆綁軟體,而是從 WordPress 側載的。為了更好的相容性,您應該使用 Gutenberg 的外掛程式版本,該版本通常比 WordPress 中包含的版本提前數個版本。
Gutenberg 替換條件如下:
- bbPress - 良好(需要 bbPress 2.6+)
- 評論 - 還好
- BuddyPress - 需要大量改進。

此外,此外掛程式為 Gutenberg 編輯器添加了新的區塊類型「內容嵌入」,使您可以從任何 bbPress 站點或 WordPress.com 支援頁面嵌入論壇主題。
Blocks Everywhere 在 GitHub 上開發:
https://github.com/Automattic/blocks-everywhere
注意事項
載入 Gutenberg 也會增加載入頁面的大小,您應該了解這一點,並在您的網站上接受它。
此功能尚未適用於基於區塊的佈景主題,必須是「傳統」佈景主題。
您應該使用最新版本的 Gutenberg 外掛程式。
使用教程
要啟用 Blocks Everywhere,您需要向 wp-config.php 中添加相關 define 代碼:
define( 'BLOCKS_EVERYWHERE_COMMENTS', true );
define( 'BLOCKS_EVERYWHERE_BBPRESS', true );
define( 'BLOCKS_EVERYWHERE_BUDDYPRESS', true );

您還可以使用 WordPress filter blocks_everywhere_comments、blocks_everywhere_bbpress 和 blocks_everywhere_buddypress。
要在 bbPress 中啟用後端編輯:
define( 'BLOCKS_EVERYWHERE_ADMIN', true );

或使用過濾器 blocks_everywhere_admin。後端編輯僅限具有 manage_options 能力的使用者(可以通過過濾器 blocks_everywhere_admin_cap 更改)。
要啟用電子郵件中的區塊轉換:
define( 'BLOCKS_EVERYWHERE_EMAIL', true );

或使用過濾器 blocks_everywhere_email。
要在編輯 bbPress 論壇、主題和回覆時啟用 Gutenberg,可以使用:
define( 'BLOCKS_EVERYWHERE_BBPRESS_ADMIN', true );

或使用 blocks_everywhere_bbpress_admin。
設定
某些設置可通過設置物件使用過濾器 blocks_everywhere_editor_settings 進行篩選。
allowUrlEmbed - 啟用或禁用 URL 的自動嵌入
replaceParagraphCode - 啟用自定義段落,將 HTML 和 PHP 代碼轉換為代碼塊
pastePlainText - 將所有粘貼的內容轉換為純文本
patchEmoji - 設置為 `true`,停止 twemoji 影響編輯器
iso.allowEmbeds - 啟用嵌入的列表
iso.blocks.allowBlocks - 啟用區塊的列表

Gutenberg 直接放在您的文章、論壇等內容上,這意味著編輯器的內容將看起來像它們將出現的頁面。但是,這也意味著頁面的樣式可能會影響編輯器。
我們尚無完美的方法來區分這些樣式,因此網站樣式可能會影響編輯器。

原文外掛簡介

Switches the default WordPress editor for comments, bbPress, and BuddyPress to use Gutenberg. These can now use a richer set of editing tools, as well as having access to the full power of Gutenberg blocks.
Admin moderation is also upgraded to use Gutenberg, and blocks are processed on the front end.
For extra security the list of available blocks is determined by the allowed tags from WordPress.
Gutenberg is not bundled and instead is side-loaded from WordPress. For better compatibility you should use the plugin version of Gutenberg, which is typically several versions ahead of the one included in WordPress.
The condition of the Gutenberg replacements are:
– bbPress – good (requires bbPress 2.6+)
– comments – alright
– BuddyPress – needs a lot of work
In addition, this plugin adds a new block type “Content Embed” for the Gutenberg editor, which allows you to embed a forum topic from any bbPress site or WordPress.com Support page.
Blocks Everywhere is developed on Github at:
https://github.com/Automattic/blocks-everywhere
Caveats
The loading of Gutenberg will also increase the page size of any page it is loaded on. You should be aware of this and willing to accept this in the context of your site.
This doesn’t yet work on block-based themes – it must be a ‘classic’ theme.
You should use the latest version of the Gutenberg plugin.
Usage
To enable Blocks Everywhere you need to add the relevant define to wp-config.php:
define( 'BLOCKS_EVERYWHERE_COMMENTS', true );
define( 'BLOCKS_EVERYWHERE_BBPRESS', true );
define( 'BLOCKS_EVERYWHERE_BUDDYPRESS', true );

You can also use the WordPress filter blocks_everywhere_comments, blocks_everywhere_bbpress, and blocks_everywhere_buddypress.
To enable back-end editing in bbPress:
define( 'BLOCKS_EVERYWHERE_ADMIN', true );

Or use the filter blocks_everywhere_admin. Back-end editing is restricted to users with the manage_options capability (can be changed with the blocks_everywhere_admin_cap filter).
To enable conversion of blocks in email:
define( 'BLOCKS_EVERYWHERE_EMAIL', true );

Or use the filter blocks_everywhere_email.
To enable Gutenberg when editing bbPress forums, topics, and replies you can use:
define( 'BLOCKS_EVERYWHERE_BBPRESS_ADMIN', true );

Or use blocks_everywhere_bbpress_admin
Settings
Some settings are available through the settings object, which is filterable with blocks_everywhere_editor_settings.
allowUrlEmbed - Enable or disable auto-embed for URLs
replaceParagraphCode - Enable the custom paragraph that converts HTML and PHP code into a code block
pastePlainText - Convert all pasted content to plain text
patchEmoji - set to `true` to stop twemoji from affecting the editor
iso.allowEmbeds - List of enabled embeds
iso.blocks.allowBlocks - List of enabled blocks
iso.className - String of classes to be assigned to the editor.
iso.__experimentalOnChange - An optional callback that is triggered when the blocks are changed.
iso.__experimentalOnInput - An optional callback that is triggered when text is input.
iso.__experimentalOnSelection - An optional callback when a block is selected.

Theme compatibility

Gutenberg is placed directly on the page along with your post, forum, etc. This means the contents of the editor will look like the page they will appear on. However, it also means that styles from the page may affect the editor.
We don’t have a perfect way of separating these styles and it is possible that styles from the page or from Gutenberg may affect the other. If you are using this plugin then it is expected that you will be able to fix any differences as appropriate for your site.
A theme compatibility option is provided which might help. You can use this with:
define( 'BLOCKS_EVERYWHERE_THEME_COMPAT', true );

Or using the filter blocks_everywhere_theme_compat.
It provides some overrides for common theme issues. However, it is generally better not to require overrides so if you are able to modify your theme and make CSS more specific then that is the best route.
For example, rather than defining a global button style (which would then affect Gutenberg), make the style specific to the areas where a button will be used.
Using Content Embed block
Content Embed block uses REST API to fetch content to be embedded. This means that site contains bbPress topics to embed should have topic REST API enabled.
Blocks Everywhere enables topic REST API on its own, so if the site with bbPress have this plugin installed and configured, its topics can be embedded.
To enable Content Embed block in the editor, pass these settings to blocks_everywhere_editor_settings filter:
add_filter( 'blocks_everywhere_editor_settings', function( $settings ) {
$settings['iso']['blocks']['allowBlocks'][] = 'blocks-everywhere/support-content';
return $settings;
} );

To enable REST API for forum topics, use next filters:
add_filter( 'blocks_everywhere_admin', '__return_true' );
add_filter( 'blocks_everywhere_admin_cap', '__return_empty_string' );

REST API is only used when creating content embed and not used to view it. So blocks_everywhere_admin_cap can return specific capability to limit users who will have access to API.
In order for Content Embed block from Blocks Everywhere to load post authors, it is required to enable author data in the topic REST API. To do it, use this filter
add_action( 'bbp_get_topic_post_type_supports', function( $supports ) {
$supports[] = 'author';
return $supports;
} );

KSES
Gutenberg outputs HTML content and this may be affected by KSES (WordPress HTML sanitisation) and other sanitisation.
The plugin provides some modifications to this so it works fine with basic blocks. You may run into problems if you are using different blocks or have customised permission levels.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Blocks Everywhere」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


trunk | 1.10.0 | 1.11.0 | 1.12.0 | 1.13.0 | 1.13.1 | 1.13.3 | 1.13.4 | 1.14.0 | 1.14.1 | 1.14.2 | 1.14.3 | 1.15.0 | 1.16.0 | 1.16.1 | 1.17.0 | 1.17.1 | 1.18.0 | 1.19.0 | 1.20.1 | 1.21.0 |

延伸相關外掛(你可能也想知道)

  • Content Aware Sidebars – Fastest Widget Area Plugin 》CAS 是迄今最快、最強大的 WordPress 側邊欄外掛程式。您可以在幾秒鐘內建立量身定制的小工具區。, 通過在不同的條件下顯示不同的小工具區,您可以優化轉化率...。
  • wpForo Forum 》ul, yet lightweight forum plugin for WordPress, wpForo Forums. It offers modern and responsive forum layouts with unique features for an efficient ...。
  • GD bbPress Attachments 》GD bbPress Attachments是一款易於使用的WordPress和bbPress插件,可用於實現bbPress論壇主題和回復的文件上傳。您可以從主插件設置面板控制文件大小,或者您...。
  • bbp style pack 》此外掛可以讓你設計和增加 bbPress 的顯示功能。, 你可以改變論壇元素的樣式,讓你的 bbPress 與你的佈景主題相符或形成對比。, 許多功能都是只需點擊一下即...。
  • Inline Image Upload for BBPress 》此外掛可啟用 TinyMCE WYSIWYG 編輯器,供 BBPress 論壇主題和回覆使用,並在編輯器的「插入/編輯圖片」對話框中添加按鈕,允許論壇使用者從其電腦上上傳圖片...。
  • bbPress Restrict Membership Forum & Private Replies for Members Only with Paid Memberships Pro 》最流行的 WordPress 私人論壇外掛, 使用 bbPress 和 Paid Memberships Pro 在您的 WordPress 網站中建立私人論壇。此外掛可讓您為免費或付費社群的成員建立安...。
  • bbPress Notify (No-Spam) 》bbPress和BuddyBoss最強大的新主題和回復通知系統,為您的論壇用戶提供個性化體驗。, 新功能!我們推出了一個Facebook Group,用於討論所有與bbpnns有關的事...。
  • GD bbPress Tools 》添加各種擴展工具到實施了 bbPress 外掛的論壇。目前的功能包括:, , 引用回覆或主題, 更改允許的 HTML 標籤和屬性, 帶有 BBCode 和 HTML 支持的使用者簽名, ...。
  • Private groups 》這是 bbPress 論壇外掛的附加功能 - 創建私人論壇群組。, 此外掛可以創建無限數量的私人論壇群組。, 接著,論壇可以被指派給一個或多個群組,使用者也可以被...。
  • Open Social Share 》WORDPRESS社交分享外掛, Social9是領先的社交增長服務提供商,通過利用社交媒體的力量幫助您增加流量和提高參與度。在此閱讀有關我們的更多信息。, https://w...。
  • reCAPTCHA for bbPress 》bbPress Google reCAPTCHA v2 是針對 bbPress 設計的免費外掛程式,可以讓您輕鬆在 bbPress 論壇上新增 Google reCAPTCHA v2 驗證功能。, bbPress Google reC...。
  • GamiPress – bbPress integration 》透過強大的遊戲化外掛程式 GamiPress,讓你的 bbPress 論壇輕鬆遊戲化!, 此外掛程式會自動將 GamiPress 與 bbPress 連結,新增活動事件及功能。, 新增的事件...。
  • CBX User Online & Last Login 》這個外掛可幫助您顯示線上使用者。可以追蹤會員、訪客和機器人,他們的計數、線上人數等等。此外,此外掛還可記錄每個使用者的上次登入時間、IP位址和裝置。,...。
  • bbPress WP Tweaks 》bbPress WP Tweaks 可以將常規側邊欄替換為特定於論壇的「bbPress側邊欄」。要設置論壇特定的側邊欄,您應選擇具有側邊欄的正確論壇包裝文件。然後選擇對現有...。
  • bbPress Toolkit 》這是一個針對bbPress論壇的瑞士刀工具包,可以設置全域選項和風格。, 這是一個針對bbPress論壇的調整和黑客工具包,可以設置全域選項和風格。, 目前的功能包...。

文章
Filter
Apply Filters
Mastodon