<?php
/**
 * Template helpers
 *
 * @package Kenta Breeze
 */

if ( ! function_exists( 'kenta_breeze_asset_url' ) ) {
	/**
	 * Get template assets file url
	 *
	 * @param $asset
	 *
	 * @return string
	 */
	function kenta_breeze_asset_url( $asset ) {
		return KENTA_BREEZE_ASSETS_URL . $asset;
	}
}

if ( ! function_exists( 'kenta_breeze_pattern_markup' ) ) {
	/**
	 * Get pattern markup
	 *
	 * @param $name
	 * @param array $args
	 *
	 * @return false|string
	 */
	function kenta_breeze_pattern_markup( $name, $args = array() ) {
		extract( $args );

		ob_start();
		include KENTA_BREEZE_PATH . 'template-parts/patterns/' . sanitize_title( $name ) . '.php';

		return ob_get_clean();
	}
}

if ( ! function_exists( 'kenta_breeze_starter_template' ) ) {
	/**
	 * Get pattern markup
	 *
	 * @param $name
	 *
	 * @return false|string
	 */
	function kenta_breeze_starter_template( $name ) {
		ob_start();
		include KENTA_BREEZE_PATH . 'template-parts/starter-templates/' . sanitize_title( $name ) . '.php';

		return ob_get_clean();
	}
}
