Get list taxonomy term slug and name attribute by url slug woocommerce product trong code PHP như thế nào? lấy danh sách các taxonomy term của attribute bằng url slug của attribute được truyền vào như thế nào? PHP: $attributeinfo = $product->get_attribute( 'xuat-xu' );if($attributeinfo!=""){ // Get the array of the WP_Term objects $term_slugs = array(); $attributeinfo = str_replace(', ', ',', $attributeinfo); $term_names_array = explode(',', $attributeinfo); if(reset($term_names_array)){ foreach( $term_names_array as $term_name ){ // Get the WP_Term object for each term name $term = get_term_by( 'name', $term_name, 'pa_xuat-xu'); // Set the term slug in an array echo 'Url: '.$term->slug.', Name: '.$term->name; } }} Với xuat-xu: là slug của attribute Kết quả: Url: bangladesh, Name: Bangladesh