Add support for images to shortcode.

This commit is contained in:
ekes 2017-06-09 15:28:57 +01:00
parent 4ed51243b5
commit dd31752b4b
2 changed files with 25 additions and 3 deletions

View file

@ -29,7 +29,10 @@ function radar_retrieve_events($settings) {
return $events;
}
function radar_retrieve_entities(array $entities) {
function radar_retrieve_entities($entities) {
if (!is_array($entities)) {
$entities = [$entities];
}
$client = radar_client();
return $client->retrieveEntityMultiple($entities);
}
@ -147,7 +150,7 @@ function _radar_method_lookup($type, $field) {
'date' => 'getDates',
'body' => 'getBody',
'url' => 'getUrlView',
'image' => 'getImageRaw',
'image' => 'getImage',
'price' => 'getPrice',
'price_category' => 'getPriceCategory',
'email' => 'getEmail',
@ -187,7 +190,13 @@ function _radar_method_lookup($type, $field) {
'link' => 'getLink',
'phone' => 'getPhone',
'opening_times' => 'getOpeningTimes',
)
),
'image' => array(
'title' => 'getTitle',
'mime' => 'getMime',
'url' => 'getUrl',
'size' => 'getSize',
),
);
return !empty($lookup[$type][$field]) ? $lookup[$type][$field] : FALSE;
}