woocommerce_variable_children_args

The WooCommerce woocommerce variable children args hook.

Description

apply_filters( 'woocommerce_variable_children_args', (unknown) $all_args, (unknown) $product, (bool) $false ); 

Parameters (3)

0. $all_args (unknown)
The all args.
1. $product (unknown)
The product.
2. $false (bool) => false
The false.

Usage

To run the hook, copy the example below.
  1. $all_args = apply_filters( 'woocommerce_variable_children_args', $all_args, $product, $false ); 
  2.  
  3. if ( !empty( $all_args ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_variable_children_args callback 
  2. function filter_woocommerce_variable_children_args( $all_args, $product, $false ) { 
  3. // make filter magic happen here... 
  4. return $all_args
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_variable_children_args', 'filter_woocommerce_variable_children_args', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_variable_children_args', 'filter_woocommerce_variable_children_args', 10, 3 ); 

Defined (2)

The filter is defined in the following location(s).

/includes/data-stores/class-wc-product-variable-data-store-cpt.php  
  1. $children['all'] = get_posts( apply_filters( 'woocommerce_variable_children_args', $all_args, $product, false ) ); 
  1. $children['visible'] = get_posts( apply_filters( 'woocommerce_variable_children_args', $visible_only_args, $product, true ) );