get_template_part() public static method

public static get_template_part ( $_view, null | array $_data = null ) : boolean | mixed | string | void
$_view
$_data null | array
return boolean | mixed | string | void
Ejemplo n.º 1
0
/**
 * Scope variables and include a template like get_template_part that's child-theme aware
 *
 * @see get_template_part
 *
 * @param string|array $template Template names (see get_template_part)
 * @param array $data Data to scope to the include
 * @param bool $return Whether to return the output (echo by default)
 * @return string|null Template output
 *
 * @since 2.3.9
 */
function pods_template_part($template, $data = null, $return = false)
{
    $part = PodsView::get_template_part($template, $data);
    if (!$return) {
        echo $part;
        return null;
    }
    return $part;
}