wc_get_loop_prop( string $prop, string $default = '' )
Gets a property from the woocommerce_loop global.
Description Description
Parameters Parameters
- $prop
-
(Required) Prop to get.
- $default
-
(Optional) Default if the prop does not exist.
Default value: ''
Return Return
(mixed)
Source Source
File: includes/wc-template-functions.php
function wc_get_loop_prop( $prop, $default = '' ) { wc_setup_loop(); // Ensure shop loop is setup. return isset( $GLOBALS['woocommerce_loop'], $GLOBALS['woocommerce_loop'][ $prop ] ) ? $GLOBALS['woocommerce_loop'][ $prop ] : $default; }
Changelog Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |