wc_set_loop_prop()WC 3.3.0

Sets a property in the woocommerce_loop global.

No Hooks.

Return

null. Nothing (null).

Usage

wc_set_loop_prop( $prop, $value );
$prop(string) (required)
Prop to set.
$value(string)
Value to set.
Default: ''

Changelog

Since 3.3.0 Introduced.

wc_set_loop_prop() code WC 8.7.0

function wc_set_loop_prop( $prop, $value = '' ) {
	if ( ! isset( $GLOBALS['woocommerce_loop'] ) ) {
		wc_setup_loop();
	}
	$GLOBALS['woocommerce_loop'][ $prop ] = $value;
}