llms_get_template_part_contents( string $slug, string $name = '' )

Get Template part contents


Parameters Parameters

$slug

(string) (Required) The slug name for the generic template.

$name

(string) (Optional) The name of the specialised template. Default is empty string.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

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

function llms_get_template_part_contents( $slug, $name = '' ) {
	$template = '';

	if ( $name ) {
		$template = llms_locate_template( "{$slug}-{$name}.php", llms()->template_path() . "{$slug}-{$name}.php" );
	}

	// Get default slug-name.php.
	if ( ! $template && $name && file_exists( llms()->plugin_path() . "/templates/{$slug}-{$name}.php" ) ) {
		$template = llms()->plugin_path() . "/templates/{$slug}-{$name}.php";
	}

	if ( ! $template ) {
		$template = llms_locate_template( "{$slug}.php", llms()->template_path() . "{$slug}.php" );
	}

	if ( $template ) {
		return $template;
	}
}


Top ↑

User Contributed Notes User Contributed Notes

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