📜  wordpress 通过 termid 获取产品类别名称 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:43.339000             🧑  作者: Mango

代码示例1
// Testing that $_GET['product-cato'] has been requested and that the product category exists.
if( isset( $_GET['product-cato'] ) && term_exists( intval($_GET['product-cato']), 'product_cat' ) ){
    // Get the corresponding WP_Term object
    $term = get_term( intval($_GET['product-cato']), 'product_cat' );
    //Display the term name for the product category
    echo '

' . $term->name . '

'; }