<?php
/**
 * Shortcode attributes
 * @var $atts
 * @var $number
 * @var $text
 */

if( !function_exists('yolo_shortcode_service') ){
    function yolo_shortcode_service($atts,  $content){
        extract(shortcode_atts(array(
            'style'              => 'index-1',
            'title'              => '',
            'service_image'      => '',
            'background_color'   => ''
            ),$atts));
        ob_start();

        $content            = wpb_js_remove_wpautop($content, true);
        ?>
            <!-- Features -->
    <div class="yolo-service-box <?php echo esc_attr($style); ?>">
                <div class="feature">
                    <?php if($service_image != ''):?>
                        <div class="icon" style="border-color:<?php echo esc_attr($background_color);?>;">
                            <div class="icon-back" style="background-color:<?php echo esc_attr($background_color);?>;" >
                                <?php echo wp_get_attachment_image(esc_attr($service_image));?>
                            </div>
                        </div>
                    <?php endif;?>    
                    <?php if($title != ''):?>
                        <h3><?php echo ($title);?></h3>
                    <?php endif;?>
                    <?php if($content != ''):?>
                        <p><?php echo ($content);?></p>
                    <?php endif;?>
                </div>
    </div>
        <?php
        $yolo_title = ob_get_contents();
        ob_end_clean();
        return $yolo_title;
    }
    add_shortcode('yolo_service','yolo_shortcode_service');
}
?>