目前,我的购物车中有可用的产品 ID,我需要检索该商品。我怎样才能做到这一点?
您可以使用get_post
$product = get_post( 27 ); $slug = $product->post_name; echo $slug;