Answer the question
In order to leave comments, you need to log in
How to remove taxonomy term when removing acf sub_field?
Greetings. In general, I create terms for custom taxonomies through the ACF repeater:
add_action('acf/save_post', 'my_acf_save_option_page', 20);
function my_acf_save_option_page() {
$screen = get_current_screen();
if (strpos($screen->id, 'theme-settings') == true) {
while( have_rows('field_615da6bb58108', 'option') ) {
the_row();
$val = get_sub_field('value');
wp_insert_term($val, 'okna-city');
wp_insert_term($val, 'dveri-city');
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question