Hi
im really struggling with the documentaion of Setting a cloneable group value for a post.
I have the following settings:
Field Group ID: ticket-addon
Group ID: group_tapgyiu2mz
Sub field ID: ticket_extra
When using this code its not working:
$field_id = 'ticket_extra';
$value = rwmb_meta( 'group_tapgyiu2mz', '', $post_id );
$value['ticket_extra'] = '2025';
rwmb_set_meta( $post_id, $field_id, $value );
But i get this output:
Array ( [0] => Array ( [ticket_price] => 1 [ticket_extra] => 999 [_state] => expanded ) [ticket_extra] => 2025 )
If i use this code from the documentation:
$field_id = 'ticket_extra';
$value = [['ticket_extra' => '2025',],];
rwmb_set_meta( $post_id, $field_id, $value );
Then i get this output, but still not working
Array ( [0] => Array ( [ticket_extra] => 2025 ) )
It says in the documentation to use $field_id, but what is the field id in a clonable group ?
Is it the:
Field Group ID: ticket-addon
Group ID: group_tapgyiu2mz
Sub field ID: ticket_extra
I tried all, but still not working.
If i just create a normal text field and use this code:
$field_id = 'test_field';
$value = '2025';
rwmb_set_meta( $post_id, $field_id, $value );
Then its working fine...