function subterms_for_softwar e_term term_id tt_id taxonomy if is_admi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
function subterms_for_software_term( $term_id, $tt_id, $taxonomy ) {
if ( is_admin() && is_tax( 'software-developers' ) ) {
$parent_term = get_term($term_id, $tt_id);
if(!is_wp_error($parent_term)) {
wp_insert_term(
$parent_term->name.' Bonuses',
'software-developers',
array(
'description' => '',
'parent' => $parent_term['term_id'],
'slug' => 'bonuses-'.$parent_term->slug
)
);
}
}
}
add_action( 'create_$taxonomy', 'subterms_for_software_term', 10, 3 );
do_action ( 'create_$taxonomy', $term_id, $tt_id );