我希望在以下图像属性中获得缩略图图像url
$product = wc_get_product( $post->ID ); //do this instead
$end_point = 'https://api.webpushr.com/v1/notification/send/sid';
//do a wp_remote_post instead of cURL
$body = array(
'title' => $product->get_name(),
'message' => 'check out now',
'target_url' => $product->get_permalink(),
'image' => $product->get_image($attr = array( 'src'=>get_the_post_thumbnail_url())), // Here I want to get Image thumbnail url. But it is not working
'sid' => '113858026',
);帮我找出数组获取图像url的问题。
发布于 2022-08-29 02:32:58
Woocommerce发布的缩略图和WordPress的帖子缩略图是相同的。要获得缩略图URL,可以使用以下代码。
get_the_post_thumbnail_url($post->ID);它会给你产品缩略图URL。
https://stackoverflow.com/questions/73522891
复制相似问题