strickdj / acf-field-address

address field addon for Advanced Custom Fields (ACF)
Other
47 stars 18 forks source link

Missing fields when using code export feature in ACF 5 #3

Closed chriswallace closed 9 years ago

chriswallace commented 9 years ago

I noticed that when I try to export a code configuration for my fields, the address field doesn't show any fields when I use the code version. Using version 5.1.8 of ACF 5 Pro with WordPress 4.1.

strickdj commented 9 years ago

I see there is a javascript error when you try to use the code exported field.

strickdj commented 9 years ago

Would you mind testing the master to see if that fixes this issue?

alloyking commented 9 years ago

Here is an example of the output. Including this in ACF 5 appears to not work if( function_exists('register_field_group') ):

register_field_group(array ( 'key' => 'group_54e610904437c', 'title' => 'Address', 'fields' => array ( array ( 'key' => 'field_54e610a64cf70', 'label' => 'Official Address', 'name' => 'address', 'prefix' => '', 'type' => 'address', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array ( 'width' => '', 'class' => '', 'id' => '', ), 'output_type' => 'html', 'address_layout' => '[[{"id":"street1","label":"address1"}],[{"id":"street2","label":"address2"}],[{"id":"city","label":"city"},{"id":"state","label":"state"},{"id":"zip","label":"Postal Code"}],[],[]]', 'address_options' => '{"street1":{"id":"street1","label":"Address1","defaultValue":"","enabled":true,"cssClass":"street1","separator":""},"street2":{"id":"street2","label":"Address2","defaultValue":"","enabled":true,"cssClass":"street2","separator":""},"street3":{"id":"street3","label":"Street 3","defaultValue":"","enabled":false,"cssClass":"street3","separator":""},"city":{"id":"city","label":"City","defaultValue":"","enabled":true,"cssClass":"city","separator":","},"state":{"id":"state","label":"State","defaultValue":"","enabled":true,"cssClass":"state","separator":""},"zip":{"id":"zip","label":"Postal Code","defaultValue":"","enabled":true,"cssClass":"zip","separator":""},"country":{"id":"country","label":"Country","defaultValue":"","enabled":false,"cssClass":"country","separator":""}}', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'locations', ), ), ), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => '', ));

endif;

strickdj commented 9 years ago

As far as I can tell, the master branch works on a fresh install of wordpress with the 2015 theme. I cant really solve the issue without more information. Try turning off all your add ons 1 by 1 and see if one is conflicting. If there is a conflict, post that information.