Template Usage #
You have to specify the type as tabs
inside the array key called type. Please specify that which button value will be active by default. Use the default key inside the array.
<?php
// multiple buttons group field like multiple radio buttons tabs
array(
'label' => esc_html__( 'Group Buttons Tab', '' ),
'id' => "_your_id",
'desc' => '',
'type' => 'tabs',
'choices' => array(
'button_1' => 'Button 1',
'button_2' => 'Button 2',
'button_3' => 'Button 3',
),
'default' => 'button_1',
'conditional' => array()
)
?>
How to fetch the data? #
Use our function called tpmeta_field(‘_your_id’) and pass the above array id key to fetch the metadata. Since the function tpmeta_field(‘_your_id’) will return the value so you have to echo the value.Â
<?php
$value = function_exists('tpmeta_field')? tpmeta_field('meta_key_id_here') : '';
echo esc_html($value);
?>