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

710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
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.