<?php
/**
 * @since TrainifyFramework 1.0.0
 * @param string $file_path, path from the trainifyframework
 * @return string full path of file inside trainifyframework
 *
 */
if( !function_exists( 'trainify_framework_file_directory' ) ){

    function trainify_framework_file_directory( $file_path ){

        $trainify_framework_path = 'inc/trainifyframework/'.$file_path;
        $parent_file_path = trailingslashit( get_template_directory() ) . $trainify_framework_path;
        $child_file_path = trailingslashit( get_stylesheet_directory() ) . $trainify_framework_path;
        if( file_exists( wp_normalize_path( $child_file_path ) ) ){
            return wp_normalize_path( $child_file_path );
        }else{
            return wp_normalize_path( $parent_file_path );
        }

    }

}

/**
 * @since TrainifyFramework 1.0.0
 * @param string $file_path, path from the trainifyframework
 * @return string full path of file inside trainifyframework
 *
 */
if( !function_exists('trainify_framework_directory_uri') ){

    function trainify_framework_directory_uri( $file_url='' ){
    
        $trainify_framework_file_url = '/inc/trainifyframework/'.$file_url;

        $theme_file_url = get_template_directory_uri() . $trainify_framework_file_url;

        return $theme_file_url;
    
    }

}

require_once trainify_framework_file_directory('core/init.php');

require_once trainify_framework_file_directory('widgets/init.php');

require_once trainify_framework_file_directory('customizer/init.php');

require_once trainify_framework_file_directory('hooks/init.php');

require_once trainify_framework_file_directory('sections/init.php');

require_once trainify_framework_file_directory('metabox/init.php');