
內容簡介
說明
輕鬆地在 Beaver Themer 中連接 ACF 欄位。無需記住欄位名稱,只需從下拉選單中輕鬆選擇即可。它會返回所有欄位名稱,跨越所有欄位分組。
Easy ACF Connect for Themer 還支持在當前文章、另一篇文章、user_id、tax_termid 或者您的 ACF 選項頁面中使用 ACF 欄位。
選擇 Easy ACF Connector,然後簡單地選擇欄位名稱。
使用條件邏輯篩選器
Easy ACF Connect for Themer 還支持使用當前文章或您的 ACF 選項頁面上的 ACF 欄位添加條件規則。為此,請選擇“Easy ACF Field”或“Easy ACF Option Field”。
支持的欄位類型:
顏色選擇器
日期選擇器
日期時間選擇器
電子郵件
文件
可彈性調整的內容
畫廊
群組
圖片(數組、網址或圖像 ID)
鏈接
消息
數字
頁面鏈接
密碼
文章對象
核取方塊
單選按鈕
範圍
關聯
重複器
分類法
選擇
文本
文本區域
時間選擇器
真假
網址
用戶
所見即所得編輯器
請注意,欄位支持意味著它將返回 ACF 值作為變量(對象、數組、字符串或數字)。它由模塊來處理返回的變量。
添加對列表中更多欄位類型的支持
如果您使用 ACF 的任何第三方或自定義欄位類型(可以在https://awesomeacf.com 找到),則可以使用您的 function.php 中的篩選器添加這些欄位:
add_filter( 'easy_acf_accepted_acf_field_types' , 'my_custom_add_acf_field_types' );
/**
* Callback that adds one or more fieldtypes to the the easy_acf_accepted_field_types filter
* @param {array} $fieldtypes array with name->value, label->value pairs
* @return {array}
* @since 1.0.0
*/
function my_custom_add_acf_fieldtypes( $fieldtypes ) {
$new_fieldtypes = array(
array( 'name' => 'custom_fieldtype' , 'label' => 'Custom Field Type' ),
);
$fieldtypes = array_merge( $fieldtypes , $new_fieldtypes );
return $fieldtypes;
}
第三方欄位類型的條件規則
目前還沒有支持或擴展第三方欄位類型的方式來使用條件規則的方法。這意味著您將無法根據類型選擇欄位類型。使用 Beaver Themer 提供的條件規則,但您需要手動輸入欄位名稱。
版本歷史:
v1.1.5
錯誤修復:在 rest 請求中添加了 permission_callback。
v1.1.4
在 Beaver Builder 的條件規則中添加了核取方塊欄位類型,因為它遺漏了。
v1.1.3
添加了所有剩餘的欄位類型(可彈性調整的內容、群組、重複器、頁面鏈接、文章對象、關聯、分類法、用戶)
v1.1.2
添加了條件邏輯設置
v1.1.1
在圖像字段上添加了圖像大小,微調了代碼,更改了測試 acf 4/5 的方式,修正了 acf 4/5 的 save_format/return_format,添加了 textdomain 和 .pot 文件。
v1.0.0
圖像和畫廊欄位支持
外掛標籤
開發者團隊
原文外掛簡介
Description
Easily connect ACF fields in Beaver Themer. No need to remember the fieldnames, easily select from the dropdown. It returns all fieldnames, across all fieldgroups.
Easy ACF Connect for Themer also supports ACF Fields on the current post, another post, user_id, tax_termid or even from your ACF Options pages.
Select the Easy ACF Connector… Then simply select the fieldname.
Using the Conditional Logic filter
Easy ACF Connect for Themer also supports adding conditional rules using ACF Fields on the current post or from your ACF Options pages. For that select either “Easy ACF Field” or “Easy ACF Option Field”.
Supported fieldtypes:
color-picker
date-picker
date-time-picker
email
file
flexible content
gallery
group
image (array, url or image ID)
link
message
number
page link
password
post object
checkbox
radio
range
relationship
repeater
taxonomy
select
text
textarea
time_picker
true_false
url
user
wysiwyg
Please note that field support means that it will return the ACF-value as a variable (object, array, string or number). It’s up to the module to handle the returned variable.
Adding support for more fieldtypes in list
If you use any third party or custom fieldtypes for ACF ( which can be found on https://awesomeacf.com ) you can add those using a filter in your function.php:
add_filter( 'easy_acf_accepted_acf_field_types' , 'my_custom_add_acf_field_types' );
/**
* Callback that adds one or more fieldtypes to the the easy_acf_accepted_field_types filter
* @param {array} $fieldtypes array with name->value, label->value pairs
* @return {array}
* @since 1.0.0
*/
function my_custom_add_acf_fieldtypes( $fieldtypes ) {
$new_fieldtypes = array(
array( 'name' => 'custom_fieldtype' , 'label' => 'Custom Field Type' ),
);
$fieldtypes = array_merge( $fieldtypes , $new_fieldtypes );
return $fieldtypes;
}
Conditional Rules for 3rd party fieldtypes
There is currently no support or way to extend for 3rd party fieldtypes using the conditional rules. This means that you won’t be able to pick fieldtypes based on the type. Use the conditional rules provided by Beaver Themer instead, but you will need to enter the fieldname manually.
version history:
v1.1.5
bugfix: added permission_callback to rest request
v1.1.4
added checkbox fieldtype to Beaver Builder conditional rules, it was missing.
v1.1.3
added all remaining fieldtypes (flexible content, group, repeater, page link, post object, relationship, taxonomy, user)
v1.1.2
added Conditional Logic settings
v1.1.1
added image-size on image fields, tweaked the code, changed way to test for acf 4/5, fixed save_format/return_format for acf 4/5, added textdomain and .pot file
v1.0.0
image and gallery field support
