<?php
if ( ! defined( 'LEGACY_CLEANING_COMPANY_VERSION' ) ) {
	define( 'LEGACY_CLEANING_COMPANY_VERSION', '0.0.1' );
}

/**
 * Enqueue scripts and styles.
 */
function legacy_cleaning_company_scripts() {
	wp_enqueue_style( 'legacy-cleaning-company-style', trailingslashit( get_template_directory_uri() ) . 'assets/css/style.css', array(), LEGACY_CLEANING_COMPANY_VERSION );

	wp_enqueue_style( 'fontawesome', trailingslashit( get_template_directory_uri() ) . 'assets/css/font-awesome/css/all.css', array(), LEGACY_CLEANING_COMPANY_VERSION );

	wp_enqueue_style( 'owl-carousel-css', trailingslashit( get_template_directory_uri() ) . 'assets/css/owl.carousel.css', array(), LEGACY_CLEANING_COMPANY_VERSION );

	// Enqueue theme JavaScript
	wp_enqueue_script( 'legacy-cleaning-company-theme', trailingslashit( get_template_directory_uri() ) . 'assets/js/theme.js',
	    array( 'jquery' ), LEGACY_CLEANING_COMPANY_VERSION,true );

	wp_enqueue_script( 'owl-carousel-js', get_theme_file_uri( '/assets/js/owl.carousel.js' ), array( 'jquery' ), true );

}
add_action( 'wp_enqueue_scripts', 'legacy_cleaning_company_scripts' );

function legacy_cleaning_company_load_dashicons_front_end() {
    wp_enqueue_style( 'dashicons' );
}
add_action( 'wp_enqueue_scripts', 'legacy_cleaning_company_load_dashicons_front_end' );

/**
 * Enqueue Editor styles.
 */
function legacy_cleaning_company_enqueue_editor_block_styles() {
	// Enqueue editor styles.
	add_editor_style( trailingslashit( get_template_directory_uri() ) . 'assets/css/editor-style.css' );
}
add_action( 'after_setup_theme', 'legacy_cleaning_company_enqueue_editor_block_styles' );

/**
 * Pattern categories.
 */
function legacy_cleaning_company_register_block_pattern_category() {
	register_block_pattern_category(
		'legacy-cleaning-company-banner',
		array(
			'label' => esc_html__( 'Banner', 'legacy-cleaning-company' ),
		)
	);
	
	register_block_pattern_category(
		'legacy-cleaning-company-services',
		array(
			'label' => esc_html__( 'Services', 'legacy-cleaning-company' ),
		)
	);
}
add_action( 'init', 'legacy_cleaning_company_register_block_pattern_category' );

/**
 * Add theme support for various features.
 */
function legacy_cleaning_company_setup() {

	load_theme_textdomain( 'legacy-cleaning-company', get_template_directory() . '/languages' );

	// Add support for block styles.
	add_theme_support( 'wp-block-styles' );
	
	// Add support for editor styles.
	add_theme_support( 'editor-styles' );
	
	// Add support for responsive embedded content.
	add_theme_support( 'responsive-embeds' );
}
add_action( 'after_setup_theme', 'legacy_cleaning_company_setup' );

/**
 * Upgrade to Pro
 */
require_once( trailingslashit( get_template_directory() ) . 'legacy-cleaning-company-pro/class-customize.php' );

/**
 * Notices
 */
require_once get_parent_theme_file_path( '/activation-notice/class-welcome-notice.php' );

/**getstart*/
require get_template_directory() . '/legacy-cleaning-company-get-theme-info.php';

if ( ! function_exists( 'legacy_cleaning_company_admin_scripts' ) ) :
    function legacy_cleaning_company_admin_scripts($hook) {
        wp_enqueue_style( 'legacy-cleaning-company-get-theme-info-css', get_template_directory_uri() . '/assets/css/legacy-cleaning-company-get-theme-info.css', false ); 
    }
endif;
add_action( 'admin_enqueue_scripts', 'legacy_cleaning_company_admin_scripts' );