Support

Account

Home Forums General Issues Taxonomy – In repeater, adding terms via php

Unread

Taxonomy – In repeater, adding terms via php

  • Hello,

    I am trying to add a taxonomy to a repeater and then add terms within adding/updating the full row.
    My setup is:
    artist_track_credits – Repeater field
    -select – Post Object
    -role – Taxonomy (Role taxonomy)

    I’m adding rows via php and the rows are adding/updating the Post Object fine, but I can’t seem to figure out the Taxonomy. How do I add terms to the taxonomy field? On the taxonomy field I have Save & Load unselected. I can add roles from wp-admin and it works as expected.
    I build the data into an array and then do the add/update.

    I have tried just submitting the role as text
    $row_data = array(‘select’ => $release[‘id’], ‘role’ => ‘Producer’);
    add_row(‘artist_track_credits’,$row_data, $artist_postID);

    I’ve tried submitting the role as the taxonomy term ID
    $row_data = array(‘select’ => $release[‘id’], ‘role’ => ’30’);
    add_row(‘artist_track_credits’,$row_data, $artist_postID);

    I’ve tried the role as text in an array
    $row_data = array(‘select’ => $release[‘id’], ‘role’ => array(‘Producer’));
    add_row(‘artist_track_credits’,$row_data, $artist_postID);

    I’ve tried the role as the taxonomy term ID in an array
    $row_data = array(‘select’ => $release[‘id’], ‘role’ => array(’30’));
    add_row(‘artist_track_credits’,$row_data, $artist_postID);

    None seem to work. Am I doing something wrong on this?

    Thanks for any help/suggestions anyone can provide!

Viewing 1 post (of 1 total)

The topic ‘Taxonomy – In repeater, adding terms via php’ is closed to new replies.