Template Usage #
You have to specify the type inside the array key called type.
<?php
array(
'label' => esc_html__( 'Your Title', 'textdomain' ),
'id' => "_your_id",
'type' => 'image', // specify the type field
'default' => '',
'conditional' => array()
)
?>
How to fetch the data? #
Use our function called tpmeta_image_field('')
 and pass the above array id key to fetch the metadata. Since the function tpmeta_image_field('')
 will return the image alt value and url so you have to echo the value.Â
<?php
$tp_image = function_exists('tpmeta_image_field') ? tpmeta_image_field('image_meta_key') : ''; // tpmeta_image_field($id, $size)
echo $tp_image['url'];
echo $tp_image['alt'];
?>