Import reference ui field

This commit is contained in:
Almira Krdzic
2018-10-18 13:36:45 +02:00
parent d3c280548b
commit d22ea58568
3 changed files with 62 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ class Wiaas_DB_Update {
'201810180444700' => 'wiaas_db_setup_create_customer_commercial_lead_table',
'201810180544702' => 'wiaas_db_update_update_commercial_lead_capabilities',
'201810180644703' => 'wiaas_db_update_add_organization_info_ui_fields',
'201810190644704' => 'wiaas_db_update_add_reference_ui_field'
);
public static function execute() {

View File

@@ -0,0 +1,52 @@
[
{
"key": "group_5bc845c001de4",
"title": "Package Reference",
"fields": [
{
"key": "field_5bc845dc7eed5",
"label": "Reference",
"name": "_wiaas_package_reference",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "product_tag",
"field_type": "select",
"allow_null": 0,
"add_term": 1,
"save_terms": 1,
"load_terms": 1,
"return_format": "id",
"multiple": 0
}
],
"location": [
[
{
"param": "post_type",
"operator": "==",
"value": "product"
},
{
"param": "post_taxonomy",
"operator": "==",
"value": "product_type:bundle"
}
]
],
"menu_order": 0,
"position": "acf_after_title",
"style": "seamless",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": 1,
"description": ""
}
]

View File

@@ -18,6 +18,15 @@ function wiaas_db_update_add_user_organization_ui_fields() {
_wiaas_import_field_group($ui_json);
}
function wiaas_db_update_add_reference_ui_field() {
$ui_json = file_get_contents( dirname( __FILE__ ) . '/data/wiaas-ui-field-reference.json' );
$ui_json = json_decode( $ui_json, true );
_wiaas_import_field_group($ui_json);
}
// private helper function