Merge pull request #18700 from woocommerce/update/18687
Before getting wc_get_loop_prop, setup the loop.
This commit is contained in:
commit
2936daaf89
|
@ -204,6 +204,8 @@ add_action( 'woocommerce_after_shop_loop', 'woocommerce_reset_loop', 999 );
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function wc_get_loop_prop( $prop, $default = '' ) {
|
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;
|
return isset( $GLOBALS['woocommerce_loop'], $GLOBALS['woocommerce_loop'][ $prop ] ) ? $GLOBALS['woocommerce_loop'][ $prop ] : $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue