llms_locate_template( string $template_name, string $template_path = '', string $default_path = '' )
Locate Template
Description Description
Parameters Parameters
- $template_name
-
(string) (Required) name of template
- $template_path
-
(string) (Optional) dir path to template
Default value: ''
- $default_path
-
(string) (Optional) default path
Default value: ''
Return Return
(string)
Source Source
File: includes/functions/llms.functions.template.php
function llms_locate_template( $template_name, $template_path = '', $default_path = '' ) { if ( ! $template_path ) { $template_path = LLMS()->template_path(); } if ( ! $default_path ) { $default_path = LLMS()->plugin_path() . '/templates/'; } // check theme and template directories for the template $override_path = llms_get_template_override( $template_name ); // Get default template $path = ($override_path) ? $override_path : $default_path; $template = $path . $template_name; if ( ! file_exists( $template ) ) { $template = ''; } // Return template return apply_filters( 'lifterlms_locate_template', $template, $template_name, $template_path ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: