<?php
/**
 * Theme bootstrap functions.
 *
 * @package Aero FSE
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! defined( 'AERO_FSE_VERSION' ) ) {
	// Replace the version number of the theme on each release.
	define( 'AERO_FSE_VERSION', '1.0.1' );
}

if ( ! function_exists( 'aero_fse_asset_url' ) ) {
	/**
	 * Return aero fse theme folder asset url
	 * 
	 * @param mixed $path
	 * @return string
	 */
	function aero_fse_asset_url( $path ) {
		return trailingslashit( get_stylesheet_directory_uri() ) . 'assets/' . $path;
	}

}

if ( ! function_exists( 'aero_fse_the_asset_url' ) ) {
	/**
	 * Echo aero fse theme folder asset url
	 * 
	 * @param mixed $path
	 * @return void
	 */
	function aero_fse_the_asset_url( $path ) {
		echo esc_url( aero_fse_asset_url( $path ) );
	}

}

if ( ! function_exists( 'aero_fse_register_block_pattern_category' ) ) {
	/**
	 * Register aero fse pattern category
	 * 
	 * @return void
	 */
	function aero_fse_register_block_pattern_category() {
		if ( function_exists( 'register_block_pattern_category' ) ) {
			register_block_pattern_category( 'aero-fse', array(
				'label' => __( 'Aero FSE Theme', 'aero-fse' )
			) );
		}
	}

}

add_action( 'init', 'aero_fse_register_block_pattern_category' );

//
// Theme dashboard hook
//
if ( ! function_exists( 'aero_fse_theme_screenshot' ) ) {
	function aero_fse_theme_screenshot() {
		return trailingslashit( get_stylesheet_directory_uri() ) . 'screenshot.png';
	}

}
add_filter( 'plover_welcome_theme_screenshot', 'aero_fse_theme_screenshot' );

if ( ! function_exists( 'aero_fse_support_forum_url' ) ) {
	function aero_fse_support_forum_url() {
		return 'https://wordpress.org/support/theme/aero-fse/';
	}

}
add_filter( 'plover_theme_support_forum_url', 'aero_fse_support_forum_url' );

if ( ! function_exists( 'aero_fse_rate_us_url' ) ) {
	function aero_fse_rate_us_url() {
		return 'https://wordpress.org/support/theme/aero-fse/reviews/?rate=5#new-post';
	}

}
add_filter( 'plover_theme_rate_us_url', 'aero_fse_rate_us_url' );

if ( ! function_exists( 'aero_fse_default_color_mode' ) ) {
	function aero_fse_default_color_mode() {
		return 'light';
	}
}
add_filter( 'plover_theme_default_color_mode', 'aero_fse_default_color_mode' );
