<?php

if (!function_exists('united_blog_is_wc_active')) :
    /**
     * Check WooCommerce Status
     *
     * @since 1.0.0
     *
     * return boolean true/false
     */
    function united_blog_is_wc_active()
    {
        return class_exists('WooCommerce') ? true : false;
    }
endif;


if (!function_exists('united_blog_get_social_display_styles')) :
    /**
     * Returns social links styles options.
     *
     * @return array Options array.
     * @since 1.0.0
     *
     */
    function united_blog_get_social_display_styles()
    {
        $options = apply_filters(
            'united_blog_social_icon_styles',
            array(
                'style_1' => __('Style 1', 'united-blog'),
                'style_2' => __('Style 2', 'united-blog'),
                'style_3' => __('Style 3', 'united-blog'),
                'style_4' => __('Style 4', 'united-blog'),
            )
        );
        return $options;
    }
endif;

if (!function_exists('united_blog_get_title_line_clamp')) :
    /**
     * Returns title limit options.
     *
     * @return array Options array.
     * @since 1.0.0
     *
     */
    function united_blog_get_title_line_clamp()
    {
        $options = apply_filters(
            'united_blog_line_clamp_options',
            array(
                '' => __('&mdash; No Limit &mdash;', 'united-blog'),
                'line-clamp-1' => __('1 Line', 'united-blog'),
                'line-clamp-2' => __('2 Lines', 'united-blog'),
                'line-clamp-3' => __('3 Lines', 'united-blog'),
                'line-clamp-4' => __('4 Lines', 'united-blog'),
                'line-clamp-5' => __('5 Lines', 'united-blog'),
            )
        );
        return $options;
    }
endif;

if (!function_exists('united_blog_get_category_display_styles')) :
    /**
     * Returns category color display options
     *
     * @return array Options array.
     * @since 1.0.0
     *
     */
    function united_blog_get_category_display_styles()
    {
        $options = apply_filters(
            'united_blog_category_color_display',
            array(
                'none' => __('None', 'united-blog'),
                'display_as_color' => __('As Color', 'united-blog'),
                'display_as_bg' => __('As Background Color', 'united-blog'),
            )
        );
        return $options;
    }
endif;


if (!function_exists('united_blog_get_post_meta')) :
    /**
     * Returns post meta display options
     *
     * @return array Options array.
     * @since 1.0.0
     */
    function united_blog_get_post_meta()
    {
        // Default options
        $options = array(
            'author'    => __( 'Author', 'united-blog' ),
            'read_time' => __( 'Post Read Time', 'united-blog' ),
            'date'      => __( 'Date', 'united-blog' ),
            'comment'   => __( 'Comment', 'united-blog' ),
        );

        if ( class_exists( 'Favorites' ) ) {
            $options['favorites'] = __( 'Favorites', 'united-blog' );
        }

        $options = apply_filters('united_blog_get_post_meta', $options);

        return $options;
    }
endif;

if (!function_exists('united_blog_widget_read_more_icons')) :
    /**
     * Returns read more icons options for widgets.
     *
     * @return array Options array.
     * @since 1.0.0
     */
    function united_blog_widget_read_more_icons()
    {
        $icons = united_blog_customizer_read_more_icons();
        $widget_icons = array();

        foreach ($icons as $key => $svg) {
            $widget_icons[$key] = ucfirst(str_replace('-', ' ', $key));
        }

        return $widget_icons;
    }
endif;

if (!function_exists('united_blog_customizer_read_more_icons')) :
    /**
     * Returns read more icons options as SVG strings.
     *
     * @return array Options array.
     * @since 1.0.0
     */
    function united_blog_customizer_read_more_icons()
    {
        $icons = array(
            'arrow-right' => united_blog_the_theme_svg('arrow-right',$return = true),
            'arrow-left' => united_blog_the_theme_svg('arrow-left',$return = true),
            'chevron-right' => united_blog_the_theme_svg('chevron-right',$return = true),
            'chevron-left' => united_blog_the_theme_svg('chevron-left',$return = true),
        );

        return $icons;
    }
endif;