wc_get_min_max_price_meta_query()
Deprecated since 3.6.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Get min/max price meta query args.
Hooks from the function
Returns
Array.
Usage
wc_get_min_max_price_meta_query( $args );
- $args(array) (required)
- Min price and max price arguments.
Changelog
| Since 3.0.0 | Introduced. |
| Deprecated since | 3.6.0 |
wc_get_min_max_price_meta_query() wc get min max price meta query code WC 10.6.2
function wc_get_min_max_price_meta_query( $args ) {
wc_deprecated_function( 'wc_get_min_max_price_meta_query()', '3.6' );
$current_min_price = isset( $args['min_price'] ) ? floatval( $args['min_price'] ) : 0;
$current_max_price = isset( $args['max_price'] ) ? floatval( $args['max_price'] ) : PHP_INT_MAX;
return apply_filters(
'woocommerce_get_min_max_price_meta_query',
array(
'key' => '_price',
'value' => array( $current_min_price, $current_max_price ),
'compare' => 'BETWEEN',
'type' => 'DECIMAL(10,' . wc_get_price_decimals() . ')',
),
$args
);
}