I'm using the the filter below to filter related posts by author, I added an author ID to test but they are not filtering by author
add_filter( 'woocommerce_product_related_posts', 'woo_custom_attribute_filter' );
function woo_custom_attribute_filter( $q ) {
array(
'orderby' => 'rand',
'posts_per_page' => $limit,
'post_type' => 'product',
'author' => 2,
'fields' => 'ids',
'meta_query' => $meta_query,
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'product_cat',
'field' => 'id',
'terms' => $cats_array
),
array(
'taxonomy' => 'product_tag',
'field' => 'id',
'terms' => $tags_array
)
)
);
//print_r($q);
return $q;
}
