Upload (multiple)
<?php
$tea_content = array(
array(
'type' => 'upload',
'title' => 'Upload multiple',
'id' => 'simple_upload_multi',
'default' => array(
array(
'url' => TEMPLATE_DIR_URI.'/img/6069-one-piece-1280x800-anime-wallpaper.jpg',
'id' => 106,
'name' => '6069-one-piece-1280x800-anime-wallpaper',
),
array(
'url' => TEMPLATE_DIR_URI.'/img/1024x734_16291_Kraken_2d_illustration_cartoon_pirates_picture_image_digital_art.jpg',
'id' => 72,
'name' => '1024x734_16291_Kraken_2d_illustration_cartoon_pirates_picture_image_digital_art',
),
),
'description' => 'Simple description to multiple upload panel',
'multiple' => true,
),
);
Retrieve data
Using the _get_option('simple_upload_multi')
method, you'll get (with a json_encode()
display):
{
"106": {
"id": "106",
"url": "http:\/\/your_complete_url\/wp-content\/uploads\/2014\/07\/6069-one-piece-1280x800-anime-wallpaper.jpg",
"name": "6069-one-piece-1280x800-anime-wallpaper"
},
"72": {
"id": "72",
"url": "http:\/\/your_complete_url\/wp-content\/uploads\/2014\/07\/1024x734_16291_Kraken_2d_illustration_cartoon_pirates_picture_image_digital_art.jpg",
"name": "1024x734_16291_Kraken_2d_illustration_cartoon_pirates_picture_image_digital_art"
}
}
Updated less than a minute ago