llms_get_template_override( string $template = '' )

Get Template Override


Description Description


Parameters Parameters

$template

(string) (Optional) [template file]

Default value: ''


Top ↑

Return Return

(mixed) [template file or false if none exists.]


Top ↑

Source Source

File: includes/functions/llms.functions.template.php

function llms_get_template_override( $template = '' ) {

	/**
	* Allow themes and plugins to determine which folders to look in for theme overrides
	*/
	$dirs = apply_filters( 'lifterlms_theme_override_directories', array(
		get_stylesheet_directory() . '/lifterlms',
		get_template_directory() . '/lifterlms',
	) );

	foreach ( $dirs as $dir ) {

		$path = $dir . '/';

	 	if ( file_exists( $path . $template ) ) {
			return $path;
		}
	}

	return false;
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.