wc_get_template_html - New helper to get the html from a template file
This commit is contained in:
parent
bcdce81606
commit
885dab8efc
|
@ -199,6 +199,17 @@ function wc_get_template( $template_name, $args = array(), $template_path = '',
|
|||
do_action( 'woocommerce_after_template_part', $template_name, $template_path, $located, $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Like wc_get_template, but returns the HTML instead of outputting.
|
||||
* @see wc_get_template
|
||||
* @since 2.5.0
|
||||
*/
|
||||
function wc_get_template_html( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
|
||||
ob_start();
|
||||
wc_get_template( $template_name, $args, $template_path, $default_path );
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Locate a template and return the path for inclusion.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue