<?php
/**
 * Theme Palace options
 *
 * @package Theme Palace
 * @subpackage FavBlog
 * @since FavBlog 1.0.0
 */

/**
 * List of pages for page choices.
 * @return Array Array of page ids and name.
 */
function favblog_page_choices() {
    $pages = get_pages();
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'favblog' );
    foreach ( $pages as $page ) {
        $choices[ $page->ID ] = $page->post_title;
    }
    return  $choices;
}

/**
 * List of posts for post choices.
 * @return Array Array of post ids and name.
 */
function favblog_post_choices() {
    $posts = get_posts( array( 'numberposts' => -1 ) );
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'favblog' );
    foreach ( $posts as $post ) {
        $choices[ $post->ID ] = $post->post_title;
    }
    wp_reset_postdata();
    return  $choices;
}

/**
 * List of category for category choices.
 * @return Array Array of post ids and name.
 */
function favblog_category_choices() {
    $tax_args = array(
        'hierarchical' => 0,
        'taxonomy'     => 'category',
    );
    $taxonomies = get_categories( $tax_args );
    $choices = array();
    $choices[0] = esc_html__( '--Select--', 'favblog' );
    foreach ( $taxonomies as $tax ) {
        $choices[ $tax->term_id ] = $tax->name;
    }
    return  $choices;
}


if ( ! function_exists( 'favblog_site_layout' ) ) :
    /**
     * Site Layout
     * @return array site layout options
     */
    function favblog_site_layout() {
        $favblog_site_layout = array(
            'wide'          => get_template_directory_uri() . '/assets/images/full.png',
            'boxed-layout'  => get_template_directory_uri() . '/assets/images/boxed.png',
        );

        $output = apply_filters( 'favblog_site_layout', $favblog_site_layout );
        return $output;
    }
endif;

if ( ! function_exists( 'favblog_selected_sidebar' ) ) :
    /**
     * Sidebars options
     * @return array Sidbar positions
     */
    function favblog_selected_sidebar() {
        $favblog_selected_sidebar = array(
            'sidebar-1'             => esc_html__( 'Default Sidebar', 'favblog' ),
            'optional-sidebar'      => esc_html__( 'Optional Sidebar 1', 'favblog' ),
            'optional-sidebar-2'    => esc_html__( 'Optional Sidebar 2', 'favblog' ),
            'optional-sidebar-3'    => esc_html__( 'Optional Sidebar 3', 'favblog' ),
            'optional-sidebar-4'    => esc_html__( 'Optional Sidebar 4', 'favblog' ),
        );

        $output = apply_filters( 'favblog_selected_sidebar', $favblog_selected_sidebar );

        return $output;
    }
endif;


if ( ! function_exists( 'favblog_global_sidebar_position' ) ) :
    /**
     * Global Sidebar position
     * @return array Global Sidebar positions
     */
    function favblog_global_sidebar_position() {
        $favblog_global_sidebar_position = array(
            'right-sidebar' => get_template_directory_uri() . '/assets/images/right.png',
            'no-sidebar'    => get_template_directory_uri() . '/assets/images/full.png',
        );

        $output = apply_filters( 'favblog_global_sidebar_position', $favblog_global_sidebar_position );

        return $output;
    }
endif;


if ( ! function_exists( 'favblog_sidebar_position' ) ) :
    /**
     * Sidebar position
     * @return array Sidbar positions
     */
    function favblog_sidebar_position() {
        $favblog_sidebar_position = array(
            'right-sidebar'         => get_template_directory_uri() . '/assets/images/right.png',
            'no-sidebar'            => get_template_directory_uri() . '/assets/images/full.png',
        );

        $output = apply_filters( 'favblog_sidebar_position', $favblog_sidebar_position );

        return $output;
    }
endif;

if ( ! function_exists( 'favblog_pagination_options' ) ) :
    /**
     * Pagination
     * @return array site pagination options
     */
    function favblog_pagination_options() {
        $favblog_pagination_options = array(
            'numeric'   => esc_html__( 'Numeric', 'favblog' ),
            'default'   => esc_html__( 'Default(Older/Newer)', 'favblog' ),
        );

        $output = apply_filters( 'favblog_pagination_options', $favblog_pagination_options );

        return $output;
    }
endif;

if ( ! function_exists( 'favblog_switch_options' ) ) :
    /**
     * List of custom Switch Control options
     * @return array List of switch control options.
     */
    function favblog_switch_options() {
        $arr = array(
            'on'        => esc_html__( 'Enable', 'favblog' ),
            'off'       => esc_html__( 'Disable', 'favblog' )
        );
        return apply_filters( 'favblog_switch_options', $arr );
    }
endif;

if ( ! function_exists( 'favblog_hide_options' ) ) :
    /**
     * List of custom Switch Control options
     * @return array List of switch control options.
     */
    function favblog_hide_options() {
        $arr = array(
            'on'        => esc_html__( 'Yes', 'favblog' ),
            'off'       => esc_html__( 'No', 'favblog' )
        );
        return apply_filters( 'favblog_hide_options', $arr );
    }
endif;
