Automattic\WooCommerce\Internal\ShopperLists

ShopperListRenderer::render_each_templatepublic staticWC 1.0

Wrap $row_inner_markup in a <template data-wp-each> element that iAPI uses to render new rows. $row_inner_markup is the inner HTML for the <li> — everything between <li> and </li>.

Trust contract: caller is responsible for ensuring $row_inner_markup contains only safe, escaped HTML.

Method of the class: ShopperListRenderer{}

No Hooks.

Returns

String.

Usage

$result = ShopperListRenderer::render_each_template( $row_inner_markup ): string;
$row_inner_markup(string) (required)
Inner markup for the <li>.

ShopperListRenderer::render_each_template() code WC 10.9.1

public static function render_each_template( string $row_inner_markup ): string {
	return sprintf(
		'<template data-wp-each--list-item="state.currentItems" data-wp-each-key="context.listItem.key"><li class="%1$s">%2$s</li></template>',
		esc_attr( self::ROW_CLASS ),
		$row_inner_markup
	);
}