wc_get_template_html - New helper to get the html from a template file

This commit is contained in:
Mike Jolley 2015-12-04 13:26:24 +00:00
parent bcdce81606
commit 885dab8efc
1 changed files with 11 additions and 0 deletions

View File

@ -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.
*