我试图在这里理解php语法,因此我只能显示当前分类术语的相关产品。我希望$args过滤器“product\\u brand”能够动态获取当前产品术语。
所以我需要一种方法来获取当前产品术语的段塞。我已经试过了,但它不起作用,而且返回了不止一个学期。
$mjrelatedproducts = get_brands( $post->ID )->slug;
$args = apply_filters(\'woocommerce_related_products_args\', array(
    \'post_type\'             => \'product\',
    \'ignore_sticky_posts\'   => 1,
    \'product_brand\'         => $mjrelatedproducts,
    \'no_found_rows\'         => 1,
    \'posts_per_page\'        => $posts_per_page,
    \'orderby\'               => $orderby,
    \'post__in\'              => $related,
    \'post__not_in\'          => array($product->id)
) );