woocommerce_variable_children_args hook.

This commit is contained in:
Mike Jolley 2015-08-13 23:35:41 +01:00
parent 5b29d23daf
commit dc1798f942
2 changed files with 5 additions and 1 deletions

View File

@ -146,6 +146,7 @@ class WC_Product_Variable extends WC_Product {
'post_status' => 'publish',
'numberposts' => -1
);
if ( $visible_only ) {
$args['meta_query'] = array(
'relation' => 'AND',
@ -166,7 +167,9 @@ class WC_Product_Variable extends WC_Product {
}
}
$this->children[ $key ] = get_posts( apply_filters('woocommerce_variable_children_args', $args, $this, $visible_only ) );
$args = apply_filters( 'woocommerce_variable_children_args', $args, $this, $visible_only );
$this->children[ $key ] = get_posts( $args );
set_transient( $transient_name, $this->children, DAY_IN_SECONDS * 30 );
}

View File

@ -163,6 +163,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Run html_entity_decode over text attributes to fix problems with quote characters.
* Tweak - Order variations by menu_order by fallback to ID.
* Tweak - Include attribute archives support in the breadcrumbs.
* Tweak - woocommerce_variable_children_args hook.
= 2.4.3 - 12/08/2015 =
* Fix - Query within wc_customer_bought_product().