0
A
回答
0
我不知道你是否能在全球所有元素設置自定義選項,但如果你正在建設一個自定義元素,你可以做這樣的事情:
vc_map(array(
"name" => __("Custom Element Name", "my-text-domain"),
"base" => "custom_element",
"params" => array(
array(
'type' => 'textfield',
'heading' => __('Container Element Width', 'my-text-domain'),
'param_name' => 'container_element_width',
'group' => __('Design options', 'my-text-domain'),
),
),
));
那麼你可以在輸出中使用該參數。
0
您可以使用vc_add_param():
https://wpbakery.atlassian.net/wiki/spaces/VC/pages/524335/vc+add+param
,並確定該組爲 「設計選項」,如:
$attributes = array(
'type' => 'textfield',
'heading' => __('My Field', 'lang_domain'),
'description' => __('Description here."', 'lang_domain'),
'param_name' => 'my_field',
'group' => __('Design Options', 'lang_domain'),
'admin_label' => true,
);
您可以添加以下這一行,你想要的任何元素:
vc_add_param('vc_element_1', $attributes);
vc_add_param('vc_element_2', $attributes);
etc...
然後你複製你想添加的元素現場從以下文件夾:
js_composer/include/templates/shortcodes/vc_element_1.php
etc...
,並把它放在一個文件夾中在你的主題或插件。您可以反正你喜歡的編輯這些文件並添加新的領域作爲變量,也許寫一個內聯CSS等:
echo '<div style="my_field: '.$my_field.';">';
或
echo '<div style="my_field: '.$atts['my_field"].';">';
然後,你需要設置該文件夾,讓VC知道和使用vc_set_shortcodes_templates_dir()讀取此簡碼:
https://wpbakery.atlassian.net/wiki/spaces/VC/pages/524294/vc+set+shortcodes+templates+dir
相關問題
- 1. Visual Composer後端編輯器自定義元素
- 2. Visual Composer Post Grid自定義查詢日期
- 3. WordPress和Visual Composer自定義頁面模板
- 4. 使用OR運算符的Visual Composer自定義查詢
- 5. Visual C#存儲和讀取自定義選項到Appdata中的自定義XML
- 6. 如何在Visual Composer中使用自定義小部件或將其轉換爲Visual Composer元素?
- 7. Android自定義首選項
- 8. 自定義VirtueMart選項
- 9. Jquery自定義選項卡
- 10. Mysqldump自定義選項
- 11. 自定義選項Magento
- 12. Visual Studio自定義項目模板
- 13. 使用自定義主題和選項的自定義選項菜單
- 14. woocommerce自定義選擇選項功能
- 15. 自定義複選框首選項
- 16. 自定義選擇選項的外觀
- 17. 自定義修復選項在MSI
- 18. 創建自定義選項卡
- 19. 自定義ObservableCollection與選定的項目
- 20. 將自定義按鈕顏色添加到Visual Composer按鈕設置
- 21. 如何在visual composer中爲自定義進度條插件創建簡碼?
- 22. Visual Composer提供ReferenceError:添加圖像時id未定義錯誤
- 23. visual composer vc_shortcodes-custom-css
- 24. MSCRM2011選項集中的自定義值
- 25. Knockout.js選項自定義數據 - 東西
- 26. 自定義菜單選項使用menu.addIntentOptions()
- 27. 通知API - 自定義選項?
- 28. 添加自定義選項的形式
- 29. Magento自定義選項與屬性
- 30. android中的自定義選項卡