'',
'items' => '',
'images' => null,
'images_ratio' => '3/4',
'pills_images' => null,
'pills_count' => 0,
'items_container_class' => '',
'size' => 'medium',
'href' => null,
'enable' => true
]);
$prefix = $args['prefix'];
if (! empty($args['prefix'])) {
$prefix .= '_';
}
$has_scale_rotate = false;
if ($args['images']) {
$args['pills_count'] = count($args['images']);
$args['items'] = '';
foreach ($args['images'] as $single_image) {
$attachment_id = is_array($single_image) ? $single_image['attachment_id'] : $single_image;
if ($has_scale_rotate) {
$args['items'] .= '
';
}
$single_item_href = $args['href'];
if (! $single_item_href) {
$single_item_href = wp_get_attachment_image_src(
$attachment_id,
$args['size']
);
if ($single_item_href) {
$single_item_href = $single_item_href[0];
}
}
$args['items'] .= '
' . blocksy_image([
'attachment_id' => $attachment_id,
'ratio' => $args['images_ratio'],
'tag_name' => 'a',
'size' => $args['size'],
'html_atts' => [
'href' => $single_item_href
],
]) .'
';
if ($has_scale_rotate) {
$args['items'] .= '
';
}
}
}
if ($args['enable']) {
$initial_value = 'no';
if ($has_scale_rotate) {
$initial_value = 'no:scalerotate';
}
$args['container_attr']['data-flexy'] = $initial_value;
}
// Pills
$has_pills = true;
// Slider view
// boxed | full
$slider_view = 'boxed';
$container_attr = '';
foreach ($args['container_attr'] as $key => $value) {
$container_attr .= ' ' . $key . '="' . $value . '"';
}
$container_attr = trim($container_attr);
?>