How to Set Parent for a Term Using wp_insert_term() in WordPress
To set the parent for a new term, you can modify the 'parent' parameter in the wp_insert_term() function like this:
$term_id = wp_insert_term(
$cname,
'qqcpat',
array(
'description' => $cdescription,
'slug' => $cnamel,
'parent' => 12,
)
);
Replace 12 with the actual ID of the parent term you want to set.
AI 优化版
原文地址:https://www.cveoy.top/t/topic/qh5g 著作权归作者所有。请勿转载和采集!