Support

Account

Home Forums Front-end Issues create new taxonomy with acf form not new post Reply To: create new taxonomy with acf form not new post

  • I do not know of any examples.

    
    acf_form(array(
      'post__id' => 'new_narocilnice',
      'field_groups' => array(
        'group_XXXXXXX'
      )
    ));
    
    
    function new_narocilnice_filter($post_id) {
      if ($post_id != 'new_narocilnice') {
        return $post_id;
      }
      // get values for new term from $_POST['acf'] values
      // https://developer.wordpress.org/reference/functions/wp_insert_term/
      $term = insert_term($term_name, $taxonomy, $other_args);
      $post_id = 'term_'.$term=>term_id;
      return $post_id;
    }