Support

Account

Home Forums ACF PRO Update oEmbed field with update_field()

Helping

Update oEmbed field with update_field()

  • Hi,
    I am trying to update an oEmbed field with the update_field function, where I am doing something similar to this:

    
    $youtube_video = 'https://www.youtube.com/watch?v=QILiHiTD3uc';
    $post_id = 12;
    
    update_field('monkey_video', $youtube_video, $post_id);
    

    But it doesn’t work. Am I doing something wrong? Couldn’t find any documentation on the topic.

    Thanks,
    Ted.

  • Are you attempting to update a field that does not already have a value? If so the you should be using the field key in update field and not the field name. See the field key section of https://www.advancedcustomfields.com/resources/update_field/

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

The topic ‘Update oEmbed field with update_field()’ is closed to new replies.