在父主题中有一个注册分类法(课程类型)的功能:
add_action( 'init', 'createTaxonomy', 99999 );
function createTaxonomy() {
$course_type = array(
'label' => 'Тип курса',
'hierarchical' => true,
'public' => true,
'show_in_nav_menus' => true,
'show_ui' => true,
'show_tagcloud' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
);
register_taxonomy('course_type', array('stm-courses'), $course_type); // category
}
我需要在子主题(可能在父主题)中添加默认标签,以便在管理面板中有例如常规课程、专业课程等。它是通过代码实现的,而不是手动实现的。如何实施?

要将术语添加到帖子中,请使用
wp_set_object_terms: