lp__get_template_part( $slug, $name = null, $load = true, $require_once = false, $args = array(), $plugin_name = LP__NAME )
The lp__get_template_part function is used to retrieve or load a plugin template. It allows you to specify a template slug and name and then attempts to locate and load the corresponding template file. The function uses the lp__get_template_path function to locate the template file within the theme directory first and then within the plugin directory if it’s not found.
Plugin
Namespace
Launchpad
Parameters
array
$args
Template arguments to pass.
bool
$load
Whether to load the template.
bool
$require_once
Whether to load the template once.
string
$slug
Template slug.
string
$name
Template name (optional).
string
$plugin_name
Plugin name to get the file from.
Return
void
Source
File: \includes\lp-utility-functions.php
function lp__get_template_part( $slug, $name = null, $load = true, $require_once = false, $args = array(), $plugin_name = LP__NAME ){
$templates = array();
if (isset($name)) $templates[] = "{$slug}-{$name}.php";
$templates[] = "{$slug}.php";
// Locate template path and load
lp__get_template_path( $templates, $load, $require_once, $args, $plugin_name );
}