Support

Account

Home Forums General Issues update_field on custom taxonomy not working

Solved

update_field on custom taxonomy not working

  • hello,

    I have a php script where I want to save a value for a custom field for a taxonomy.

    I am trying using:
    update_field(‘field_55ea58bfea9fc’, $value, $tag_id);

    with no luck: the values in wp_options are not updated.

    what am I doing wrong?

  • What is the taxonomy and what is in $tag_id;

    The post id (where you have $tag_id) should be $taxonomy_slug.'_'.$term_id

  • John, thank you so much!

    $tag_id was = $term_id
    my bad for being unfamiliar with the proper terms.

    I did prefix it with the $taxonomy_slug like you explained and now it works perfectly.

  • I figured that $tag_id was $term_id and that you were just misting the tax prefix. It’s an easy thing to overlook until you get used to it.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘update_field on custom taxonomy not working’ is closed to new replies.