Merge pull request #963 from IanDelMar/patch-6
WooCommerce backward compatibility. Fix for #961 - Thx @IanDelMar !
This commit is contained in:
commit
2d80cf410b
|
@ -138,3 +138,27 @@ if ( ! function_exists( 'understrap_wc_form_field_args' ) ) {
|
||||||
return $args;
|
return $args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! function_exists( 'wc_review_ratings_enabled' ) ) {
|
||||||
|
/**
|
||||||
|
* Check if reviews are enabled.
|
||||||
|
*
|
||||||
|
* Function introduced in WooCommerce 3.6.0., include it for backward compatibility.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function wc_reviews_enabled() {
|
||||||
|
return 'yes' === get_option( 'woocommerce_enable_reviews' );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if reviews ratings are enabled.
|
||||||
|
*
|
||||||
|
* Function introduced in WooCommerce 3.6.0., include it for backward compatibility.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function wc_review_ratings_enabled() {
|
||||||
|
return wc_reviews_enabled() && 'yes' === get_option( 'woocommerce_enable_review_rating' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Reference in New Issue