You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On example page 2 I call the fields
carbon_get_post_meta(post->ID, 'benefits');
It tries to return the field values for example page 2, using the field names from example page 1. It seems that it uses the first found complex field name, no matter of the page ID.
The result is below:
[0]=>
array(4) {
["_type"]=>
string(7) "benefit"
["image"]=>
string(0) ""
["title"]=>
string(0) ""
["description"]=>
string(0) ""
}
The result should be:
[0]=>
array(4) {
["_type"]=>
string(7) "benefit"
["process_thumbnail"]=>
string(0) ""
["benefit_title"]=>
string(4) "test"
["benefit_text"]=>
string(4) "test"
}
Is there some work around to get the right values ?
The text was updated successfully, but these errors were encountered:
When upgrading carbon fields from version 1.6 to 3.1 I experience the following problem:
I have two complex fields with same names on two different pages.
code example on page 1:
Container::make('post_meta','Home fields')
->where('post_id', '=', get_option( 'page_on_front' ))
->add_tab('Benefits',array(
Field::make('complex', 'benefits')
->set_layout('tabbed-horizontal')
->setup_labels(array(
'singular_name' => 'Benefit',
'plural_name' => 'Benefits',
))
->add_fields('benefit', array(
Field::make('image', 'image','Image')
Field::make('text', 'title','Title'),
Field::make('textarea', 'description','Description'),
))
))
code example on page 2:
Container::make('post_meta','City Service Page Fields')
->where( 'post_type', '=', 'city_page' )
->add_tab('Tab 1', array(
Field::make('complex','benefits', 'How it works')
->set_layout('tabbed-horizontal')
->setup_labels(array(
'singular_name' => 'Benefit',
'plural_name' => 'Benefits',
))
->add_fields('benefit', array(
Field::make('image','process_thumbnail', 'Thumbnail')
Field::make('text', 'benefit_title', 'Benwfit title')
Field::make('textarea', 'benefit_text', 'Benefit text')
))
))
On example page 2 I call the fields
carbon_get_post_meta(post->ID, 'benefits');
It tries to return the field values for example page 2, using the field names from example page 1. It seems that it uses the first found complex field name, no matter of the page ID.
The result is below:
[0]=>
array(4) {
["_type"]=>
string(7) "benefit"
["image"]=>
string(0) ""
["title"]=>
string(0) ""
["description"]=>
string(0) ""
}
The result should be:
[0]=>
array(4) {
["_type"]=>
string(7) "benefit"
["process_thumbnail"]=>
string(0) ""
["benefit_title"]=>
string(4) "test"
["benefit_text"]=>
string(4) "test"
}
Is there some work around to get the right values ?
The text was updated successfully, but these errors were encountered: