內容簡介
這是一個增強 WordPress Gutenberg 編輯器,讓使用者可以使用自定義查詢建立動態區塊的外掛。
自定義查詢區塊
首個區塊是「自定義查詢區塊」,可以使用自定義查詢建立動態區塊。
「自定義查詢區塊」附帶 3 個基本的模板,存放於外掛的 /templates 目錄中。
您可以透過在您的主題中建立一個 /template-parts/blocks/ 子文件夾,覆寫或建立自己的模板供該區塊使用。
外掛會掃描啟用的主題中的此目錄,並將此目錄中的所有 PHP 模板匯入其中,因此您可以透過「自定義查詢區塊」
檢查器設置來選擇它們。
範本可以包含任何內容,您可以存取$attributes陣列,其中包含該特定區塊的所有選擇數據,以及該區塊的$post_query對象。
功能
友善的開發者介面
易於使用
自訂範本
外掛標籤
開發者團隊
原文外掛簡介
A plugin to extend WordPress Gutenberg editor and allow for dynamic blocks to be built using custom queries.
Custom Query Block
Our first block, Custom Query Block allow for dynamic blocks to be built using custom queries.
The Custom Query Block comes with 3 basic templates which are stored in the plugin /templates directory.
You can override or create your own templates for the block to use by creating a /template-parts/blocks/ sub folder in your theme.
The plugin will scan active themes for this directory and pull in all PHP templates from this directory so you can select them
via the Custom Query Block inspector settings.
Templates can contain anything you like and you’ll have access to the $attributes array which has all the selection data for
that particular block, as well as the $post_query object for that block.
Features
Developer Friendly
User Friendly
Custom Templates
