woocommerce_shortcode_products_query хук-фильтрWC 1.0

Tags.

Использование

add_filter( 'woocommerce_shortcode_products_query', 'wp_kama_woocommerce_shortcode_products_query_filter', 10, 3 );

/**
 * Function for `woocommerce_shortcode_products_query` filter-hook.
 * 
 * @param  $query_args 
 * @param  $attributes 
 * @param  $type       
 *
 * @return 
 */
function wp_kama_woocommerce_shortcode_products_query_filter( $query_args, $attributes, $type ){

	// filter...
	return $query_args;
}
$query_args
-
$attributes
-
$type
-

Где вызывается хук

WC_Shortcode_Products::parse_query_args()
woocommerce_shortcode_products_query
woocommerce/includes/shortcodes/class-wc-shortcode-products.php 235
$query_args = apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type );

Где используется хук в WooCommerce

woocommerce/includes/class-wc-template-loader.php 385
add_filter( 'woocommerce_shortcode_products_query', array( __CLASS__, 'unsupported_archive_layered_nav_compatibility' ) );
woocommerce/includes/class-wc-template-loader.php 387
remove_filter( 'woocommerce_shortcode_products_query', array( __CLASS__, 'unsupported_archive_layered_nav_compatibility' ) );