Link
<?php
$tea_content = array(
array(
'type' => 'link',
'title' => 'Never gonna give you up!',
'id' => 'my_link_field_id',
'description' => 'Never gonna give you up!',
'expandable' => true,
'default' => array(
'url' => "http://www.youtube.com/watch?v=BROWqjuTM0g",
'label' => 'Never gonna get you down!', //optional, display link instead
'target' => '_blank', //optional, "_self" by default
'rel' => 'nofollow', //optional, "external" by default
),
),
);
Retrieve data
Using the _get_option('my_link_field_id')
method, you'll get (with a json_encode()
display):
{
"url": "http://www.youtube.com/watch?v=BROWqjuTM0g",
"label": "Never gonna get you down!",
"target": "_blank",
"rel": "nofollow"
}
{
"1":{
"url":"https://www.youtube.com/watch?v=tFPSeCeMqOU",
"label":"Ben L'Oncle Soul - Petite soeure",
"target":"_blank",
"rel":"follow"
},
"2":{
"url":"https://www.youtube.com/watch?v=otCpCn0l4Wo",
"label":"MC Hammer - Can't touch this",
"target":"_blank",
"rel":"nofollow"
}
}
Updated less than a minute ago