[WordPress] 外掛分享: Jinx-Block-Renderer

WordPress 外掛 Jinx-Block-Renderer 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Jinx-Block-Renderer」是 2020-08-11 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2020-12-03,距離現在已有 1613 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.1 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

lugat |

外掛標籤

blocks | template | gutenberg | manipulate |

內容簡介

這個外掛可以讓你解析所有類型的 Gutenberg 區塊,並在你自己的模板中呈現它們。

使用方法

在你的佈景主題中使用過濾器 ‘jinx_block_renderers’ 來呈現 Gutenberg 區塊。

function my_render_function(array $fields)
{
echo $fields['url'];
}

add_filter('jinx_block_renderers', function($renderers) {

$renderers[] = [
'block' => 'core-embed/youtube', // 區塊的名稱
'conditions' => [], // 預設值 - 接受一個鍵值對的陣列
// 'conditions' => [
// 'className' => 'is-style-custom', // 字串會用在正規表示式中
// 'field' => function($value) { // 回呼函數會接收值並必須回傳 true 或 false
// return $value === 'some value';
// }
// ],
'fields' => [
'url' => [ // 你的參數名稱
'path' => '//iframe[@src]',
'item' => 0,
// 'item' => 9, // 如果不存在,會回傳 null
// 'item': 'first', // 常數 Jinx\BlockRenderer\Field::ITEM_FIRST
// 'item': 'last', // 常數 Jinx\BlockRenderer\Field::ITEM_LAST
// 'item': null // 預設值 - 將所有結果作為陣列回傳
'attr' => 'src',
//'attr' => null // 預設值 - 回傳結果的值
//'filter' => 'my_filter_function' // 對每個匹配到的欄位使用過濾器
],
],
// 'insert' => '//*[contains(@class,"wp-block-")]' // 預設值 - 將呈現的區塊插入回區塊包裝器中
'template' => __DIR__.'/youtube-video.php', // 相對路徑,模板會將每個欄位視作變數
// 'callback' => 'my_render_function'
];

return $renderers;

});

?>

原文外掛簡介

The plugin allows you to parse all kinds gutenberg blocks and render them in your own template.
Usage
Use the filter ‘jinx_block_renderers’ in your theme to render gutenberg blocks.
'core-embed/youtube', // name of the block
'conditions' => [], // default - accepts an array of key value pairs
// 'conditions' => [
// 'className' => 'is-style-custom', // strings are used inside a regular expression
// 'field' => function($value) { // callbacks will receive the fields value and must return true or false
// return $value === 'some value';
// }
// ],
'fields' => [
'url' => [ // name of your parameter
'path' => '//iframe[@src]',
'item' => 0,
// 'item' => 9, // if not exists, will return null
// 'item': 'first', // constant Jinx\BlockRenderer\Field::ITEM_FIRST
// 'item': 'last', // constant Jinx\BlockRenderer\Field::ITEM_LAST
// 'item': null // default - returns all results as an array
'attr' => 'src',
//'attr' => null // default - returns the results value
//'filter' => 'my_filter_function' // filters each matched field
],
],
// 'insert' => '//*[contains(@class,"wp-block-")]' // default - inserts rendered block back into the block-wrapper
'template' => __DIR__.'/youtube-video.php', // relative path, templates will handle each field as a variable
// 'callback' => 'my_render_function'
];

return $renderers;

});

?>

各版本下載點

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

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


最新版本

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

  • Spectra Gutenberg Blocks – Website Builder for the Block Editor 》a.com/tutorials/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme" rel="nofollow ugc">Spectra tutorials, you can easily learn how to ...。
  • SiteOrigin Widgets Bundle 》rdPress website since 2013. Our Widgets Bundle is actively developed and regularly updated to ensure compatibility with the latest WordPress update...。
  • Gutenberg Blocks with AI by Kadence WP – Page Builder Features 》Kadence Blocks 是一個 WordPress 外掛,它附加自訂區塊和選項,擴展了 Gutenberg 編輯功能,使您能夠輕鬆創建美麗的網站,而不需要任何程式編寫。Kadence Bl...。
  • Extendify 》Extendify 是一個網站設計和製作工具平台,提供豐富的圖案和全頁面佈局,可用於 Gutenberg 區塊編輯器,幫助人們建立美麗的 WordPress 網站。, 使用 Extendif...。
  • Page Builder Gutenberg Blocks – CoBlocks 》, 注意:對於已受 CoBlocks 3.0.0 版本影響的使用者,請查看我們在 WordPress.org 支援論壇文章,如果您需要支援,請建立新的主題帖。, , CoBlocks 是新版 Gu...。
  • Otter Blocks – Gutenberg Blocks, Page Builder for Gutenberg Editor & FSE 》Otter 是一款 Gutenberg Blocks 頁面建構外掛,可為 WordPress Block Editor(又稱 Gutenberg)添加額外功能,讓您享受更好的頁面建構體驗,而無需使用傳統的...。
  • GenerateBlocks 》將不同的功能整合至編輯器,但並不會因為過多的一維方塊造成內容過於臃腫。使用 GenerateBlocks,您只需深入學習少量的方塊,即可用於創建任何內容。, Genera...。
  • Widget Options – The #1 WordPress Widget & Block Control Plugin 》3>Widget Options 讓您新增更多選項至小工具設定中,讓您完全控制網站的小工具。該外掛已下載超過 1,060,000 + 次,平均評價為 4.9 星,毫無疑問,Widget Opt...。
  • Widget Logic 》此外掛可在每個小工具中新增一個名為 "Widget logic" 的額外控制欄,讓您控制這個小工具會出現在哪些頁面上。文字欄位允許您使用 WP 的Conditional Tags或任...。
  • Starter Sites & Templates by Neve 》一個基於雲端的模板庫,可讓您使用1個按鈕創建或使用現有的網站模板。, 超過100個初學者網站和模板可用於最流行的頁面構建器, 免費和付費模板和起始網站可供...。
  • Stackable – Page Builder Gutenberg Blocks 》終極與古鐸版衣搭檔, Stackable 是您一直在等待的終極可靠古鐸版衣搭檔。使用堅強、輕便的自訂區塊、現成設計、UI套件、全域設定和高級自訂選項建立動態網站...。
  • Layout Grid Block 》想要輕鬆設定自訂欄位寬度和位置的列排版嗎?也許您想要在文章中將內容對齊全局佈局網格。使用此佈局網格區塊,您可以實現以上兩個目標,或是其中一個。此外...。
  • Kubio AI Page Builder 》, , Kubio 是一個創新的基於區塊的 WordPress 網站建立工具,它以全新的區塊來擴充編輯器功能並提供使用者無限的樣式選項。透過先進的編輯功能,Kubio 使用者...。
  • Content Views – Post Grid & Filter, Recent Posts, Category Posts … (Shortcode, Blocks, and Elementor Widgets) 》易於篩選與顯示文章、頁面的方格/列表, 我們認為一個美麗的文章方格能夠令你的 WordPress 網站更加出眾,並保持訪客的參與度。這就是為什麼我們開發了 Conten...。
  • WooCommerce Blocks 》WooCommerce Blocks 是在文章和頁面中顯示產品的最簡單、最靈活的方式!, 如需更多關於可用區塊及其使用方式的信息,請查看官方文檔:https://docs.woocommer...。

文章
Filter
Apply Filters
Mastodon