Home Forums Backend Issues (wp-admin) Taxonomy term name(value) > to post meta field


Taxonomy term name(value) > to post meta field

  • Good day friends, I am coming back to ACF and need your help with one thing because I don’t know how to achieve this.. There is many information about it but any doesn’t fit my needs and custom functions just doesn’t work.

    What I am trying to do is: GET taxonomy ‘car_model’ term name(value) ‘bmw’ and paste it (parse) inside custom post type ‘cars’ meta field ‘car_model’.

    Maybe someone can help me with this? I am not strong in coding, but would be really appreciated for help.

    I am trying to use this code:

    `function my_acf_save_post( $post_id ) {
    $field = get_field_object( ‘car_model’ );
    $value = $field[‘value’];
    $label = $field[‘choices’][ $value ];
    $value1 = get_field( ‘car_model’, $post_id );

    update_field( ‘car_model’, $value1, $post_id );
    add_action(‘acf/save_post’, ‘my_acf_save_post’, 20);

    Anyone can help me with this?

    1) There is a lot of terms, but only 1 will be available to choose from all and display.
    2) I need this function to parse term name(value) to custom post meta field.
    3) No really I am just beginner who is trying to study hard to work with PHP, WP, ACF once again without stopping.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.