dozent_get_template_path( null $template = null )

Get dozent template path


Parameters

$template

(null) (Optional)

Default value: null


Return

(bool|mixed|void)


Source

File: includes/core-functions.php

	function dozent_get_template_path( $template = null ) {
		if ( ! $template ) {
			return false;
		}
		$template = str_replace( '.', DIRECTORY_SEPARATOR, $template );

		/**
		 * Get template first from child-theme if exists
		 * If child theme not exists, then get template from parent theme
		 */
		$template_location = trailingslashit( get_stylesheet_directory() ) . "dozent/{$template}.php";
		if ( ! file_exists( $template_location ) ) {
			$template_location = trailingslashit( get_template_directory() ) . "dozent/{$template}.php";
		}
		if ( ! file_exists( $template_location ) ) {
			$template_location = trailingslashit( DOZENT_ABSPATH ) . "templates/{$template}.php";

			if ( ! file_exists( $template_location ) ) {
				dozent_notice( sprintf( __( 'The file you are trying to load is not exists in your theme or dozent plugin location : %s ',
					'dozent' ), $template_location ), 'warning' );
			}
		}

		return apply_filters( 'dozent_get_template_path', $template_location, $template );
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.