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: ''
Return Return
(string)
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; } }
Expand full source code Collapse full source code View on GitHub