test function term_id tt_id taxonomy if is_admin is_tax software-devel

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
$test = function( $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_software-developers', '$test', 10, 3 );