wcps_layout_element_css_$id

Display custom CSS for elements

//add_action('wcps_layout_element_css_$id','wcps_layout_element_css_$id', 10);
// $id = 'post_title'
// $id = 'wrapper_start'
// $id = 'wrapper_end'
// $id = 'thumbnail'
// $id = 'content'
// $id = 'product_category'
// $id = 'product_tag'
// $id = 'sale_count'
// $id = 'featured_mark'
// $id = 'on_sale_mark'
// $id = 'add_to_cart'
// $id = 'rating'
// $id = 'product_price'
// $id = 'product_id'



add_action('wcps_layout_element_css_post_title','wcps_layout_element_css_post_title_20200331', 90);

function wcps_layout_element_css_post_title_20200331($args){


    $product_id = isset($args['product_id']) ? $args['product_id'] : '';
    $elementData = isset($args['elementData']) ? $args['elementData'] : array();
    $element_index = isset($args['element_index']) ? $args['element_index'] : '';
    $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';

    $color = isset($elementData['color']) ? $elementData['color'] : '';
    $font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
    $font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
    $margin = isset($elementData['margin']) ? $elementData['margin'] : '';
    $text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';

    ?>
    <style type="text/css">
        .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
        <?php if(!empty($color)): ?>
            color: <?php echo $color; ?>;
        <?php endif; ?>
        <?php if(!empty($font_size)): ?>
            font-size: <?php echo $font_size; ?>;
        <?php endif; ?>
        <?php if(!empty($font_family)): ?>
            font-family: <?php echo $font_family; ?>;
        <?php endif; ?>
        <?php if(!empty($margin)): ?>
            margin: <?php echo $margin; ?>;
        <?php endif; ?>
        <?php if(!empty($text_align)): ?>
            text-align: <?php echo $text_align; ?>;
        <?php endif; ?>
        }
    </style>
    <?php
}